Hi
I have noticed that the lotusscript ‘getnextdocument’ method will only process one document out of several identical (virtually) documents. ie the docs are in the alldocuments view of a mail file and have the same sender, date, size and subject. When I process through the docs, I only get one of the docs. Is this how it is designed to work?
Subject: getnextdocument only misses identical docs
use while loop to process all docsset Doc=docscollection.getfirstdoc
While Not (Doc Is Nothing)
your code
Set Doc = Viewname.GetNextDocument(Doc)
Wend
Subject: RE: getnextdocument only misses identical docs
When processing documents in a loop, be careful if you delete the document, or modify it in a way that causes it to disappear from the view or for its position to change. In these cases, this method may not return a useful result, because the document that was the next document, is now at a different position in the view. The most common symptom of this problem is that documents are skipped when you loop through them.
To address this issue, change your logic so that you call GetNextDocument before making any change to the document. Or, use NotesView.AutoUpdate (= False) to prevent re-indexing of the view while you’re using it.
Subject: RE: getnextdocument only misses identical docs
Hi
Thanks for your posts. I am in a loop using while not doc is nothing. I have tested with a small agent that just prints the subject of the memo and it still has the problem.
I invite you to perform the test. The key is to ensure you have two documents that are virtually identical in the view. I am not sure whether they only need to be identical in the values represented in the columns or in all fields. The created date etc were different.
The code extract is below.
Call maildb.OpenWithFailover(mailServer, mailFile)
Set vwAll = maildb.GetView("$All")
Set doc = vwAll.GetFirstDocument
'For each document,
While Not (doc Is Nothing)
Print "Document is " + doc.Subject(0)
Set doc=vwAll.GetNextDocument(doc)
Wend
Subject: RE: getnextdocument only misses identical docs
If you Print the same string twice in a row, Notes doesn’t bother to put the new string to the status bar.