Examples: AppendDocLink method

  1. This script creates a new mail memo. In the Body item of the memo, the script places a doclink to the current database.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim newDoc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Set db = session.CurrentDatabase
    Set newDoc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( newDoc, "Body" )
    Call rtitem.AppendDocLink( db, db.Title )
    newDoc.Subject = "Here is a link to the database"
    newDoc.SendTo = "Lauri Nodwell"
    newDoc.Send( False )
  2. This script creates a new mail memo. In the Body item of the memo, the script places a doclink to the Boots folder in the current database.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim newDoc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Set db = session.CurrentDatabase
    Set view = db.GetView( "Boots" )
    Set newDoc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( newDoc, "Body" )
    Call rtitem.AppendDocLink _
    ( view, view.Name & " in " & db.Title )
    newDoc.Subject = "Here is a link to the Boots folder"
    newDoc.SendTo = "Lauri Nodwell"
    Call newDoc.Send( False )
  3. This script creates a new mail memo. In the Body item of the memo, the script places a doclink to the first document in the Boots folder in the current database.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim view As NotesView
    Dim newDoc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase
    Set view = db.GetView( "Boots" )
    Set newDoc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( newDoc, "Body" )
    Set doc = view.GetFirstDocument
    Call rtitem.AppendDocLink _
    ( doc, doc.Subject( 0 ) & " in " & view.Name )
    newDoc.Subject = _
    "Here is a link to first document in the Boots folder"
    newDoc.SendTo = "Lauri Nodwell"
    Call newDoc.Send( False )
  4. This script creates a new mail memo. In the Body item of the memo, the script places a doclink to each document in the Boots folder in the TEST.NSF database. Each doclink is followed by a tab, the Subject item of the document being linked to, and a carriage return.
    Dim session As New NotesSession
    Dim db As New NotesDatabase("", "test.nsf")
    Dim view As NotesView
    Dim newDoc As NotesDocument
    Dim rtitem As NotesRichTextItem
    Dim doc As NotesDocument
    Set view = db.GetView( "Boots" )
    Set newDoc = New NotesDocument( db )
    Set rtitem = New NotesRichTextItem( newDoc, "Body" )
    Set doc = view.GetFirstDocument
    While Not ( doc Is Nothing )
      Call rtitem.AppendDocLink( doc, db.Title )
      Call rtitem.AddTab( 1 )
      Call rtitem.AppendText( doc.Subject( 0 ) )
      Call rtitem.AddNewLine( 1 )
      Set doc = view.GetNextDocument( doc )
    Wend
    newDoc.Subject = _
    "Here are links to all docs in the Boots folder"
    newDoc.SendTo = "Lauri Nodwell"
    Call newDoc.Send( False )