Dim s As New NotesSession
dim db as NotesDatabse
Dim targetdb As New NotesDatabase( "", "VIP.nsf" )
Dim dc As NotesDocumentCollection
Dim checkdc As NotesDocumentCollection
Dim doc As NotesDocument
dim found as integer
set db = s.CurrentDatabase
set checkdc = db.UnprocessedDocuments
set doc = checkdc.GetFirstDocument
do while not doc is nothing
found = false
Set dc = targetdb.Search( |Lastname = "| + doc.LastName(0) + |"|,Nothing,0 )
if dc.Count > 0 then
found = true
'Hier gibt es einen Treffer:
else
' Kein Treffer: Dok. kann kopiert werden
end if
loop 'do while not doc is nothing
/quote]
nach else hat noch was gefehlt:
Call doc.CopyTodatabase(targetdb)
Jetzt muss ich noch die Werte, die übereinstimmen in einer Picklist oder so ausgeben
mal schaun, ob ich das ansatzweise hinkriege...
dankeschön
hierbei stürzt mein Notes ab.
Habs mir auch im Debugger angeguckt.
Scheint eine Endlosschleife zu sein
'Prüfe Nachname
Set dc = targetdb.Search( |LastName = "| + doc.LastName(0) + |"|,Nothing,0 )
'Wenn Übereinstimmung dann prüfe Vorname
If dc.Count > 0 Then
Set dc = targetdb.Search( |FirstName = "| + doc.FirstName(0) + |"|,Nothing,0 )
If dc.Count > 0 Then
'Hier gibt es einen Treffer:
found = True