Examples: RemovePermanently method

This agent performs a hard or soft deletion of the current document depending on "Allow soft deletions" and user preference.

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  Dim dc As NotesDocumentCollection
  Set dc = db.UnprocessedDocuments
  Dim doc As NotesDocument
  Set doc = dc.GetFirstDocument
  If db.GetOption(DBOPT_SOFTDELETE) Then
    If Messagebox("Do you want a hard deletion?", _
    MB_YESNO + MB_ICONQUESTION, "Hard or soft") = IDYES Then
      Call doc.RemovePermanently(True)
    Else
      Call doc.Remove(True)
    End If  
  Else
    Call doc.Remove(True)
  End If
End Sub