Domino 9 und frühere Versionen > Entwicklung
Bookmarks anlegen
chock:
Hallo,
ich möchte über einen Button Bookmarks direkt als Symbol in die Lesezeichenleiste legen.
Wenn ich es mit dieser Formal versuche funktioniert es zwar aber man muss noch einen Ordner auswählen, wo es hin soll.
@Command([FileOpenDatabase];"Server":"xy.NSF");
@Command( [AddBookmark] ; Name Bookmark ; Ordner )
Wie könnte ich dies automatisieren d.h. Button drücken -> Symbol in der Lesezeichenleiste?
Danke
chock:
Habe jetzt was gefunden wie es funktioniert.
Nur weiß ich jetzt noch nicht wo ich die UNID$ meiner Bildresource finde.
I needed to do the same thing for a "Corporate Portal" database. We wanted all Notes users to have an icon on the bookmark bar to open the "Corporate Portal". The below code is what we used to achieve this. Basically the "Create_NACHOME_Bookmark" sub is called from the PostOpen event of the Database Script of the Corporate Portal database. (we sent a db link to users and when they clicked on the link this code was executed). You'll notice I have a variable called "unid$". This is the unid of a custom icon image that is in the Image Resource area of the corporate portal database. This unid$ is used to find the image resource in the Corporate Portal db and copy it to the users bookmark.nsf database. Good Luck
/Jack
Sub Create_NACHOME_Bookmark
Dim outline As NotesOutline
Dim oeNew As NotesOutlineEntry
Dim oeRef As NotesOutlineEntry
Dim oeTmp As NotesOutlineEntry
Dim NoMore As Variant
Dim session As New NotesSession
Dim db As NotesDatabase
Dim imageDocument As NotesDocument
Dim currentDB As NotesDatabase
Dim s As New NotesSession
Dim Done, Found As Variant
Dim unid$
unid$ = "FB43BB676B7A3DF8852568200071AC2C"
Set currentDB = s.CurrentDatabase
Set db = New NotesDatabase( "", "bookmark.nsf" )
'Set doc = db.getdocumentbyUNID(unid$)
'If doc Is Nothing Then
Set imageDocument = currentDB.GetDocumentByUNID( unid$ )
Call imageDocument.CopyToDatabase( db )
'End If
Set outline = db.GetOutline("UserBookmarkOrder")
Set oeTmp = outline.GetFirst()
label$ = ""
Done = False
referenceFound = False
nacEntryFound = False
Do While Done = False
If oeTmp Is Nothing Then
Done = True
Else
label$ = oeTmp.Label
If label$ = "NACHOME" And oeTmp.Level = 0 Then '..entry already exists
nacEntryFound = True
Done = True
Else
If label$ = "To Do" Then
referenceFound = True '..found where we normally put the bookmark, but let's keep looking incase the user has placed the bookmark somewhere else
Set oeRef = oeTmp
End If
Set oeTmp = outline.GetNextSibling(oeTmp)
End If
End If
Loop
Set oeNew = outline.CreateEntry("NACHOME")
Call oeNew.SetNoteLink(currentDB)
If nacEntryFound Then
Exit Sub
Else
If referenceFound Then
Call outline.AddEntry(oeNew, oeRef,True,False)
Else
Call outline.AddEntry(oeNew, ,True,False)
End If
oeNew.ImagesText = "NACHOME"
Call outline.save()
End If
End Sub
Driri:
Die UNID solltest Du über die Eigenschaften der Bildressource auslesen können (der Tab mit "Karlsson auf dem Dach"). Sonderzeichen mußt Du aus dem String entfernen.
chock:
Habe jetzt diese ID komplett eingetragen ohne Sonderzeichen. Fehlermeldung "Invalid ID".
Habe diese ID genommen siehe Anhang
Driri:
Oopsa, da hab ich mich etwas mißverständlich ausgedrückt ;)
Du brauchst nur die ID in der zweitletzten Zeile (DB...)
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln