Does anyone know of a way to open a document by the DocumentID? I have a process that adds a doclink of another document in a different DB to a richtext field, but I have users that click the Save button on the document that I just put the link on. Since the UIDocument is not refreshed with the new doclink on it, when they click Save it doesn’t save the doclink to the document. What I am trying to do is after saving the doclink to the back-end document, I want that document to close and reopen without user intervention. I have tried to use the Reload and Refresh methods of the NotesUIDocument class, but they don’t exactly work the correct way all the time. So I need to find another way. Does anyone have any ides?
Thanks in advance,
Dave
Subject: opening a document by notesid
Save the doc w/LotusScript… for example, this snippet saves the uidoc and then gets it’s unid from the backend and reopens it again in the ui. Does this work?
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.currentdatabase
Dim uidoc As NotesUIDocument
Dim w As New NotesUIWorkspace
Set uidoc = w.currentdocument
Call uidoc.Save
Dim backendDoc as NotesDocument
Set backendDoc = uidoc.Document
unid$ = backendDoc.UniversalID
Dim againdoc As NotesDocument
Set againdoc = db.GetDocumentByUNID(unid$)
If Not (againdoc Is Nothing) Then
Call uidoc.Close
Set uidoc =.EditDocument(True, againdoc, True )
End If
Subject: RE: opening a document by notesid
That worked perfectly.
Thanks Stan you are a life saver.
Dave