Hello,i am trying to create a script to remove double entries in a folder from lotus. i do not know what is wrong, sometimes the script just stops, sometimes i get the error that the Object varioable not set (or something like that.
I have checked with the debugger, and the error of variable not set comes to dco1 8in the script) which makes no sense, because the loop should exit when doc1 is nothing.
when running the script in debugger and checking variable values, i see very strange things happening, namely with doc1 values, sometimes , after a document has been deleted, it does not get the next value (when saying getnext) but the last value of the whole list of documents, which makes no sense (to me and a colleague that looked with me)
Can anybody help
here is the script, i use a lot of variables because i have seen in the forums that using a getnext with the same variable can cause errors
Dim session As New NotesSession
Dim db As notesdatabase
Dim allhtml As NotesView
Dim doc1 As notesdocument
Dim doc2 As notesdocument
Dim doc3 As notesdocument
Dim doc4 As notesdocument
Dim doc5 As notesdocument
Dim doc6 As notesdocument
Dim messago As String
Dim messag2 As String
Set db =session.currentdatabase
Set allhtml = db.getview("HTMLPDFSent")
Set doc1=allhtml.getlastdocument
Set doc4 = doc1
Do While Not (doc1 Is Nothing)
Set doc4 = doc1
Set doc2 = allhtml.getprevdocument (doc1)
Do While Not (doc2 Is Nothing)
' Messagebox doc2.Subject (0), MB_OK, "doc2"
Set doc6 = doc2
If Trim(Ucase(doc1.Subject(0))) = Trim(Ucase(doc2.Subject(0))) Then
Set doc3 = doc2
Set doc2 = allhtml.getprevdocument (doc6)
doc3.remove True
Else
Set doc2 = allhtml.getprevdocument (doc6)
End If
Loop
Set doc5 = allhtml.getprevdocument (doc4)
Set doc1 = doc5
Messagebox doc1.Subject (0), MB_OK, "doc1"
Loop
thanks for any help…