Examples: PostSave event

  1. This script closes a document after it has been saved.
    Sub Postsave(Source As Notesuidocument)  
      Call Source.Close
    End Sub
  2. This example sends a copy of a new or edited document to anyone listed in the "Reviewers" field after the document has been saved.
    Sub Postsave(Source As Notesuidocument)
      Dim session As New NotesSession
      Dim workspace As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      Dim doc As NotesDocument
      Dim doc2 As NotesDocument
      Dim item As NotesItem
      Set uidoc = workspace.CurrentDocument
      Set doc = uidoc.Document
      Set db = session.CurrentDatabase
      Set doc2 = New NotesDocument(db)
      Set item = doc.GetFirstItem("Subject")
      Call item.CopyItemToDocument(doc2, "Subject")
      Set item = doc.GetFirstItem("Reviewers")
      Call item.CopyItemToDocument(doc2, "SendTo")
      Set item = doc.GetFirstItem("Body")
      Call item.CopyItemToDocument(doc2, "Body")
      Call doc2.Send(False, doc.Reviewers)
    End Sub