Prompt to save uidoc when leaving edit mode

This should be simple enough, but for some reason it doesn’t work as expected…

I’m trying to copy the contents of an email (BODY rich text item) into a rich text item of a form in another application.

I put the email uidoc in edit mode, go to the body field, select all, copy and then put it back in read mode. That’s when I get prompted if I want to save my changes!

The strange thing is that it happens on two out of the 3 clients where I tried it…

Even with everything except the uidoc.EditMode=False/True commented out, I get the warning.

Any ways to avoid it while keeping this functionality (no backend document processing)

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument



Set uidoc = workspace.CurrentDocument



uidoc.EditMode = True

’ Call uidoc.GotoField(“Body”)

’ Call uidoc.SelectAll

’ Call uidoc.Copy

uidoc.EditMode = False

End Sub

thanks,

–T

Subject: Use backend classes…

You are making it much more complicated that it has to be. Don’t try to automate things that way, just use backend classes.

Look up the CopyItemToDocument of the NotesRichtextItem class, that should be a good start.