Refresh or reopen current document in Client

I have a document open in read mode. When a user clicks on a link on this document, it runs an agent. This much works. But I need to refresh/reopen as the agent made changes to the document. The agent is Lotuscript and the link is a quickaction.

Subject: RE: Refresh or reopen current document in Client

The EditDocument method will do this. uiws.Close the document first using True (immediate) argument.

Subject: RE: Refresh or reopen current document in Client

Thank you for your response.

I wrestled with this before responding. Here is my code.

===

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Call uidoc.Close(True)

Set doc = db.GetDocumentByUNID(docUID)

Set workspace = New NotesUIWorkspace

Call workspace.EditDocument(False,doc)

===

The document closes, but crashes Lotus applications after that. I can’t even debug it even if break is set at the close statement. The bad line is the editdocument. I refetched the document and new workspace because I was not sure they were valid after closing (and I did a save on the “doc” in code before this clip).

Regards,

Durwin

Subject: RE: Refresh or reopen current document in Client

Since you don’t mention a specific error message, I’m not sure what you mean by “crashes Lotus applications.”

Your code uses a variable docUID which you seem to be assuming will contain the document universal ID, but the variable is not assigned in the code you show.

The statement Set workspace = New NotesUIWorkspace doesn’t do anything useful.

You might need to delete the old NotesDocument object before re-loading it using its ID. These things are cached, and it might remember it was accessed thru a uidoc.

Subject: RE: Refresh or reopen current document in Client

I’m sorry for being vauge. That was just a clip from the agent. Yes, the docUID was assigned. Here is the error. It appears on a red square (not even a dialog box) with black border.

===

Sorry, an uncorrectable error has occurred.

lookuphandle: handle not allocated

===

I’d try to delete the old document object, but that still leaves me with the crash when editdocument gets run.

Regards,

Durwin