Closing a notesuidoc w/o save prompt.

When I try to close a notesuidoc it prompts the user if they want to save the doc before it is closed even though I save the doc in the script.  Is there a way around notes giving the user this prompt?  Sorry I only have 18 points to give :~(
Who is Participating?
mchampouConnect With a Mentor Commented:
Try the following :

If you need to save the doc before closing it, use the UIDoc method "Save"

then call the UIDoc method "Close".

If you don't want to save the doc before closing it, you can do the following :

with the NotesDocument, call the replaceitemvalue method with the following parameters:

Call Doc.ReplaceItemValue("SaveOptions", "0")

Then call the UIDOC.Close method.

Give it a shot :-)

Create a hidde field on the doc and name it 'SaveOptions' and set its default value to 1.

What Gus has said works assuming you always want to save the document. But if you only want to save it conditionally, then your script needs to save the document. Without knowing what your script is doing, it is hard to say why it is not saving the document properly. One suggestion I can make though is that if you are using @commands then try using @postedcommand for the file save.

Doc.SaveOptions = 0  where "doc" is the "Background Class" document NOT the NotesUIDocument then you "close" the UI Document.
All Courses

From novice to tech pro — start learning today.