Examples: DeleteDocument method (NotesUIDocument - LotusScript)
- This script closes the current document and marks it for deletion.
If the document is in Edit mode, however, the script does nothing.
Sub Click(Source As Button) Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument If Not ( uidoc.EditMode ) Then Call uidoc.DeleteDocument End If End Sub
- This script incorrectly tries to categorize the current document
after calling DeleteDocument.
Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument If Not ( uidoc.EditMode ) Then Call uidoc.DeleteDocument Call uidoc.Categorize( "Purged" ) 'error, since uidoc object is not valid End If