EditDocument => how prevent from saving an opened document

Dear All,

I have created a toolbar button whose click provokes a form to be opened. This form runs some code that allows me to create then to edit (open) a new (pre-filled) calendar document.

Dim uiw As New NotesUIWorkspace

Dim db As New NotesDatabase(“”, “”)

Call db.openmail

Dim doc As NotesDocument

Set doc = db.CreateDocument()

'set a lot of Item to the document to make it a calendar document, fill the body, the location, the subject etc …

Call doc.AppendItemValue(“ApptUNID”,doc.UniversalId)

Call doc.Save(True, False)

Call uiw.editDocument(True, doc)

When my users click on my button, the new pre-filled calendar document is opened. All works perfectly but my problem is the following:

let’s suppose that my customer clicks on the button, and immediatly decides to close the opened calendar document without any change. When he closes the document, the document is saved as a draft in the calendar. How can I avoid that this document is saved when there is no change?

I would like to reproduce the same behaviour as when an user decides to open a new email or calendar appointment: if he opens a new document then immediately closes it, the document is not saved.

Thanks in advance for your help,

Mikaël Donini,

Arkadin France.

Subject: Just don’t save it.

I guess you should start creating the coument in the mailfile via uiworkspace.compse or something.

Subject: SaveOptions

Seach for SaveOptions in Designer help

Thomas

http://www.notessidan.se