NotesUIWorkspace.EditDocument can get bypassed?

I have found a condition in which NotesUIWorkspace.EditDocument(…) fails.

Case 1: new document opens in UI

Dim workspace As New NotesUIWorkspace

…create a document object and populate

Call doc.Save(True,False)

Call workspace.EditDocument(True,doc)

Messagebox “Account " + doc.PhoneAcs(0) + " has been created”,64," Account Creation"

Case 2: does not open in UI

Dim workspace As New NotesUIWorkspace

…create a document object and populate

Call doc.Save(True,False)

Messagebox “Account " + doc.PhoneAcs(0) + " has been created”,64," Account Creation"

Call workspace.EditDocument(True,doc)

So it’s cause by the sequence. Any ideas why?

Subject: Follow up

Sorry, I should really check my facts before submitting. You may want to try adding the NewInstance flag.

Subject: no - tried that :frowning:

regardless of whether you set True or false

Subject: Focus…

I think this is all about the focus on screen. When you call workspace.editdocument, you are editing the currently selected document.

I think the messagebox is moving focus away from the document and not returning it after it is cancelled/clicked etc.