I would like to open a Notes document in READ Mode from within Microsoft Word utilizing the OLE automation. The code seems to be straight forward:
Dim notesWS As Object
Dim notesUIDoc As Object
Set notesWS = CreateObject(“Notes.NotesUIWorkspace”)
Call notesWS.OpenDatabase([ServerName], [DBPATH], [View], [Key])
Set notesUIDoc = notesWS.EDITDOCUMENT(False)
notesuiDoc = Nothing
noteWS = Nothing
But what happens is, that the document is opened (on top of the view), the cursor stays as hourglass and a server exception is thrown (-2147417851 (80010105)).
Afterwards the Notes Client can be recovered just by re-login into Windows or an enforced NSD dump run.
If I change the code in the following way:
Dim notesWS As Object
Dim notesUIDoc As Object
Set notesWS = CreateObject(“Notes.NotesUIWorkspace”)
Call notesWS.OpenDatabase([ServerName], [DBPATH], [View], [Key])
Set notesUIDoc = notesWS.EDITDOCUMENT
notesuiDoc.Document.SaveOptions = False
notesuiDoc.EditMode = False
notesuiDoc = Nothing
noteWS = Nothing
astonishing all happens as I would expect: The document appears opened in READ mode.
But when I try to open another document from the view that was opened by this procedure an NSD dump runs.
Does anybody have experience with EditDocument() in READ mode from within OLE automation and can help me??