I have a button on a view the will update a field with the server time and then print the document.
Everything works fine however when the “Call uidoc.Close” executes the “Do you want to save your changes?” message box appears.
I am using the Doc.SaveOptions = “0” so why does this happen and how to I get around it?
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim uiws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim printDate As NotesDateTime
Dim item As NotesItem
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc= collection.GetFirstDocument
Do Until doc Is Nothing
Set uidoc = uiws.EditDocument(True,doc)
Call uidoc.Print(1,,)
Set printDate = New NotesDateTime("Today")
Set item = doc.ReplaceItemValue( "CTA_PrintDate", printDate)
Call doc.Save(False, False)
Doc.SaveOptions = "0"
Call uidoc.Close
Set doc= collection.GetNextDocument(doc)
Loop
End Sub