Hallo Felix
So, habe den Code noch mal überarbeitet
Das ganze in einen Button gepackt und schon kann es losgehen. Die Zeilen, die du anpassen musst, habe ich kommentiert.
Dim outline As NotesOutline
Dim oeNew As NotesOutlineEntry
Dim oeTmp As NotesOutlineEntry
Dim oeRef As NotesOutlineEntry
Dim db As NotesDatabase
Dim s As New NotesSession
Dim Done, Found, NoMore As Variant
'Hier wird die einzufügende Datenbank festgelegt
Dim LinkDB As New NotesDatabase ("Comm1/Witte/de", "Global\Workflow\orga.nsf")
newEntry$ = "Organisationsverzeichnis" ' wie soll der Eintrag heißen ?
Set db = New NotesDatabase( "", "bookmark.nsf" )
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$ = newEntry$ And oeTmp.Level = 0 Then '..entry already exists
nacEntryFound = True
Done = True
Else
If label$ = "To Do" Then
referenceFound = True
Set oeRef = oeTmp
End If
Set oeTmp = outline.GetNextSibling(oeTmp)
End If
End If
Loop
Set oeNew = outline.CreateEntry(newEntry$)
Call oeNew.SetNoteLink(LinkDB)
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 = "btasks" ' Hier kommt der Name oder der Alias einer Bildressource aus der bookmark.nsf rein
Call outline.save()
End If
eknori