Hi guys, I am creating a button, by which it detect a number of selected document in view, and then compose a new document on each of the selected document.
The problem is, when I select 3 documents in the view and run the code, instead of generating one new document on each selected document, it generate 3 same document on the first selected document. Below is the code, hope you guys can help me out… I suspect the problem is with the GetNextDocument.
Dim session As New NotesSession
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim Uidoc As NotesUIDocument
Set db= session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
While Not(doc Is Nothing)
Set Uidoc = workspace.ComposeDocument( "", "", "InvoiceForm" )
Call Uidoc.Save
Call Uidoc.Close
Set doc = collection.GetNextDocument(doc)
Wend