NotesUiWorkspace in Mailbox jumps to other database when open

Hello,

I have the below code in post open of a form in my application. When a document is kept open and I try to flag a mail in inbox, i hav Type mismatch error in Notes 8.5

Dim ws As NotesUIWorkspace

Dim uiDoc As NotesUIDocument

Set ws = New NotesUIWorkspace

Set uiDoc = ws.CurrentDocument

My problem is with my mail box.

When I choose a mail and try to add or edit follow up flag from inbox, it throws an error in ws.currentdocument.close in Viewrefresh of FollowUpUtilities. This happens because uidoc has the handle of the document open in other database.Is there any work around.

Any help is appreciated.

Thanks.

Subject: NotesUIWorkspace issue

Tried using Source instead of UIWorkspace in Posteven, tried delete source at end of post open. Both didn’t work.

Can somebody help me with this issue or give me options to try?