I am trying to process a list of documents that were selected in a view. I have the following code:Sub Initialize
Dim session As New NotesSession
Dim docSubmit As NotesDocument
Dim varDocUNID As Variant
Dim docSelected As NotesDocument
Dim db As NotesDatabase
'Get the document that was submitted with the embedded form
Set docSubmit = session.DocumentContext
Set db = docSubmit.ParentDatabase
Print |<font face="Verdana">|
Print "Results"
'Get the field that contains the UNID’s of the selected documents (array)
varDocUNID = docSubmit.GetItemValue("$$SelectDoc")
'Make sure that at least one document was selected
If varDocUNID(0) = "" And Ubound(varDocUNID) = 0 Then
Print "No documents were selected.<BR>"
Else
If docSubmit.runagent(0) = "1" Then
'Loop through all the documents that were selected
Forall unid In varDocUNID
Set docSelected = db.GetDocumentByUNID(unid)
Print unid & "<BR>"
If Not docSelected Is Nothing Then
docSelected.current="0"
Call docSelected.Save (True, False)
End If
End Forall
Print "<BR><BR>"
Print "The documents you selected have been processed"
Print "<BR><BR>"
Print |<Center><input type="button" value="Return to view" onClick="history.back();"></Center>|
Print |</Font>|
End If
End If
End Sub
The “RESULTS” and unid values are printed (i.e. displayed on a web page) but the print statements that I have after the forall loop finishes processing all the docs does not print, it is missing in action. I can’t figure out why…
Any ideas???
Thanks
Cynthia