Examples: NotesDocument class

  1. This script creates a new document in the current database, sets its Subject, and saves it. The document does not have a form associated with it; if a user opens the document in the user interface, Notes® uses the default database form to display it.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument ( db )
    doc.Subject = "New building"
    Call doc.Save( True, True )
  2. This script creates a new document in the current database, sets its Form and Body items, and saves it. If a user opens the document in the user interface, Notes® uses the Status form to display it (if a form by that name exists in the current database).
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument ( db )
    doc.Form = "Status"
    doc.Body = "Client meeting postponed."
    Call doc.Save( True, True )
  3. This script creates and mails (but doesn't save) a new document from the current database. It sets the Form to "Memo" so that its recipient can read it as a mail memo. The document is encrypted for Susanna Coil.
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
    Set db = session.CurrentDatabase
    Set doc = New NotesDocument( db )
    doc.Form = "Memo"
    doc.Subject = "Reminder!"
    doc.EncryptOnSend = True
    doc.Body = "A document awaits your approval in " _
    + db.Title
    Call doc.Send( False, "Susanna Coil" )