LS:
Set notesUIDocument = notesUIWorkspace.EditDocument( [editMode] , [notesDocument] , [notesDocumentReadOnly] , [documentAnchor$] , [returnNotesUIDocument] , [newInstance] )
Das NotesDocument-Object (also das richtige Dokument in der richtigen Datenbank) mußt Du dir natürlich vordem selber per Script suchen. Wenn Du das dann aber hast (z.B. per db.view.GetDocumentByKey ) ist die zugehörige Datenbank ja schon im NotesDocument-Object enthalten.
Funktioniert hier immer fehlerfrei.
Komisch, genau das hat bei mir nicht funktioniert. Ich poste mal den Code, vielleicht mache ich ja irgendwo groben Unfug.
Sub Click(Source As Button)
Dim uiws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim matriculation As String
Dim mddb As NotesDatabase
Dim mddbView As NotesView
Dim mddbDoc As NotesDocument
Dim mddbServer As String
Dim mddbName As String
Set uidoc = uiws.CurrentDocument
mddbServer = uidoc.FieldGetText("$mddbServer")
mddbName = uidoc.FieldGetText("$mddbName")
Set mddb = New NotesDatabase(mddbServer, mddbName)
If (mddb Is Nothing) Then
'Stammdatenbank nicht gefunden
Else '(mddb Is Nothing)
'Dokument in Stammdatenbank öffnen
matriculation = uidoc.FieldGetText("matriculation")
Set mddbView = mddb.GetView("peoplebymatriculation")
Set mddbDoc = mddbView.GetDocumentByKey(matriculation, True)
If (mddbDoc Is Nothing) Then
'Dokument nicht gefunden
Else
'Dokument öffnen
Call uiws.EditDocument(True,mddbDoc,False,,False,False)
End If
End If '(mddb Is Nothing)
End Sub
Bis zum Aufruf von EditDocument geht alles einwandfrei. Diesen Befehl bricht er allerding mit "invalid or nonexistent document" ab.
Viele Grüße
Harry