Examples: SetNoteLink method

  1. This example sets the Type property of the first entry in the products outline to Link - Database and the Value property to the name of the database being linked to -- in this case, it's a database called URLTESTER.NSF Note that notesDatabase is the first parameter and does not require empty objects to be passed for the remaining two parameters.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim db2 As New NotesDatabase("","")
    Dim outline As NotesOutline
    Dim entry As NotesOutlineEntry
    
    Set db = session.CurrentDatabase
    Set outline = db.GetOutline("products")
    Set entry = outline.GetFirst()
    Call db2.Open("","urlTester.nsf")
    Call entry.SetNoteLink(db2)
    Call outline.save()	
  2. This example sets the Type property of the child of the first entry in the products outline to Link - View and the Value property to By Category. Note that because notesView is the second parameter, an empty object is passed in for the first parameter, but the third parameter is not needed.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim outline As NotesOutline
    Dim entryA As NotesOutlineEntry
    Dim entryB As NotesOutlineEntry
    Dim v As NotesView
    Dim emptyDB As NotesDatabase
    
    Set db = session.CurrentDatabase
    Set v = db.GetView("By Category")
    Set outline = db.GetOutline("products")
    Set entryA = outline.GetFirst()
    Set entryB = outline.getChild(entryA)
    Call entryB.SetNoteLink(emptyDB,v)
    Call outline.save()	
  3. This example sets the Type property of the last entry in the products outline to Link and the Value property to the first document in the document collection. Note that the first and second parameters are passed in as empty objects because the notesDocument is the third parameter.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim collection As NotesDocumentCollection
    Dim doc As NotesDocument
    Dim outline As NotesOutline
    Dim entry As NotesOutlineEntry
    Dim v As NotesView
    Dim emptyDB As NotesDatabase
    Dim emptyView As NotesView
    
    Set db = session.CurrentDatabase
    Set collection = db.AllDocuments
    Set doc=collection.GetFirstDocument
    Set outline = db.GetOutline("products")
    Set entry = outline.GetLast()
    Call entry.SetNoteLink(emptyDB,emptyView,doc)
    Call outline.save()