Examples: OnUnload event

  1. This OnUnload event verifies that the user wants to exit.
    %INCLUDE "lsconst.lss"
    
    Sub Onunload(Source As Notesuidocument, _
    Continue As Variant)
      If Messagebox _
      ("Do you really want to exit?", _
      MB_YESNO, "Exit?") = IDNO Then
        Continue = False
      End If
    End Sub
  2. This OnUnload event mails the current document to whomever is listed in the SendTo field if the user so wishes.
    %INCLUDE "lsconst.lss"
    
    Sub Onunload(Source As Notesuidocument, _
    Continue As Variant)
      If Messagebox _
      ("Do you want to mail this document?", _
      MB_YESNO, "Exit?") = IDYES Then
        Call Source.Send
      End If
    End Sub