Subject: RE: WebQuerySave agent and explicit save (Why not?)
Hey Morten,
Well I got a first for you, because my save method does return true. After a few minutes of making a few additional tests, I discovered something interesting.
I wrote up the simplest WebQuerySave Agent which is the following:
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim s As New NotesSession
Dim doc As NotesDocument
Set doc = s.DocumentContext
If doc.Save(True, True) Then
Print “Document Saved”
Else
Print “Document NOT Saved”
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
THE RESULTS: You were right, the save method returned false.
At this point I said to myself “What the heck is going on!”, because the save method in my real application did return true. After examining my initial script and a few tests, I discovered that simply adding the line doc.SaveOptions = “1” before calling the save, made my save method return True.
For example, the save method of the following script does return true (and the only difference with the previous script is the doc.SaveOptions = “1” line.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim s As New NotesSession
Dim doc As NotesDocument
Set doc = s.DocumentContext
doc.SaveOptions = “1” '<<<<<<<< new line
If doc.Save(True, True) Then
Print “Document Saved”
Else
Print “Document NOT Saved”
End If
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have any suggestions, ideas of what might be going on.
Thanks,
Gaston