Domino 9 und frühere Versionen > ND6: Entwicklung
DocumentCollection auf doppelte E-Mail Adressen prüfen
koehlerbv:
Ich dächte, ich hätte schon alles geschrieben. Was geht Dir denn noch ab ? Du musst doch nur vor dem Erweitern der List auf das eventuelle Vorhandensein des Elements prüfen und im positiven Fall das gerade bearbeitete Dokument löschen.
Bernhard
chris2212:
Hallo Bernhard,
wenn ich mit IsElement meine Liste auf doppelte
Werte im SendTo Feld prüfen möchte bekomme
ich Object Variable not set :-(
Dim session As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Dim docList List As String
Dim counter As Integer
Set db = session.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
counter = -1
While Not (doc Is Nothing)
counter = counter +1
docList(counter) = doc.SendTo(0)
Set doc = col.GetNextDocument(doc)
Wend
If Iselement (docList(doc.SendTo(0))) = True Then
Call doc.Remove(True)
End If
Danke & Gruß
Chris
chris2212:
Hallo,
jetzt geht´s :-)
Falls jemand mal ein ähnliches Problem hat
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim col As NotesDocumentCollection
Dim doc As NotesDocument
Dim docDelete As NotesDocument
Dim docList List As String
Dim counter As Integer
Set db = session.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
counter = -1
While Not (doc Is Nothing)
counter = counter +1
If Iselement (docList(doc.SendTo(0))) Or doc.SendTo(0) = "" Then
Set docDelete = doc
Else
docList(doc.SendTo(0)) = doc.SendTo(0)
End If
Set doc = col.GetNextDocument(doc)
If Not (docDelete Is Nothing) Then
Call docDelete.Remove(True)
End If
Wend
End Sub
Gruß
Chris
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln