Domino 9 und frühere Versionen > ND7: Entwicklung
About Database Dokument von Datenbanken anzeigen
Johnson:
>:D Ich hab's!!!
Das Feld "Body" meiner Maske "AboutDocument" bekommt jetzt nicht mehr den Inhalt von "$Body" sonder einen DocLink auf das About Dokument. Die Maske selbst soll den ersten DocLink aufführen (Maskeneingeschaft).
Den Code habe ich umgestellt:
--- Code: ---Sub Initialize
Dim db As NotesDatabase
Dim db_check As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc_tmp As NotesDocument
Dim doc_about As NotesDocument
Dim rti_body As NotesRichTextItem
Dim s As NotesSession
Dim uiws As NotesUIWorkspace
' ### initialize ###
On Error Goto errorhandler
Set s = New NotesSession
Set db = s.CurrentDatabase
' ### show the about database document of the selected databases ###
' get the about database document from the selected database
Set db_check = New NotesDatabase("", "")
Call db_check.OpenMail
Set doc_about = db_check.GetDocumentByID("FFFF0002")
If doc_about Is Nothing Then
Messagebox {The database } & db_check.Title & { has no "About Database" dokument!}, MB_OK + MB_ICONSTOP, db.Title
Goto terminate
End If
' create a temporary document and add a document link to the about database document
Set doc_tmp = db.CreateDocument
doc_tmp.Form = "AboutDatabase"
Set rti_body = doc_tmp.CreateRichTextItem("Body")
Call rti_body.AppendDocLink(doc_about, db_check.Title)
Call rti_body.Update
' show temporary document
Set uiws = New NotesUIWorkspace
Call uiws.EditDocument(False, doc_tmp, True)
' ### terminate ###
terminate:
Set uiws = Nothing
Set rti_body = Nothing
Set doc_tmp = Nothing
Set doc_about = Nothing
Set db_check = Nothing
Set dc = Nothing
Set db = Nothing
Set s = Nothing
Exit Sub
' ### error handling ###
errorhandler:
Messagebox "Module: " & "ShowAboutDatabase (Agent)" & Chr(10) & _
"Procedure: " & "Initialize" & Chr(10) & _
"Error: " & Error() & Chr(10) & _
"Code: " & Err() & Chr(10) & _
"Line: " & Erl & Chr(10), _
MB_OK + MB_ICONSTOP, _
db.Title
Stop
Resume terminate
End Sub
--- Ende Code ---
Und siehe da? Das Dokument wird so geöffnet, wie ich es haben wollte. Hehehe. Notes bietet doch immer irgend eine Lösung für das eigentlich simpelste Problem.
;)
Johnson:
Genau Bernhard. ;D Warst bloß schneller beim posten.
Johnson:
Nur der Vollständigkeit halber: Das mit dem DocLink funtioniert nur wenn die Zeildatenbank auch eine "Default view" hat. Ansonsten kommt die Meldung "Couldn't get default View id for database (xy.nsf)". So z.B. bei den Hilfe-Datenbanken des Notes Clients.
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln