I’m running into an error and could use some help. Lines 38 & 40 generate the same error message, which only appears in the debugger. Other side effect is that save conflicts are being created if further edits are made to the document.
here’s the code…
Sub GetDocumentLinks (db As NotesDatabase, uidoc As NotesUIDocument)
Dim db2 As NotesDatabase
Dim view As notesview
Dim view2 As notesview
Dim relview As notesview
Dim cdoc As NotesDocument
Dim doc As notesdocument
Dim item As NotesItem
Dim rtitem As NotesRichTextItem
Dim contnum As String
Dim curcat As Variant
Dim server As Variant
Dim path As Variant
Dim key As String
Dim ad As String
Dim formname As String
Dim searchitem As String
On Error Goto ErrorRoutine
Print "Getting the Document Links"
Dim session As New NotesSession
Dim w As New NotesUIWorkspace
Set db = Session.CurrentDatabase
server = db.server
Set cdoc = uidoc.document
cdoc.saveoptions = "0"
Call uidoc.close
'.
'.do work on the backend document (cdoc)
'.
Call cdoc.save(True,False, True)
Call view.Refresh
' ***** Error start on next line & error message only occurs if debugger is running.
' ***** Error Message: unexpected condition 4412:NotesError - Specified command is not avaliable from the workspace.
Call w.ViewRefresh
'***** If we commented out the above line, then the next line generates same error
Set uidoc = w.EditDocument ( True, cdoc, False)
Call uidoc.gotofield("rtfassociated") 'this is the doc link field
Set cdoc = uidoc.document
'cdoc.saveoptions = 1
Call cdoc.removeitem("SaveOptions")
cdoc.removeitem("stopdoclock")
Call cdoc.Save(True, False, True)
Exit Sub
ErrorRoutine:
Messagebox "Unexpected Condition " & Err () & ": " & Error()
Err = 0
Exit Sub
End Sub