Examples: FieldContains method

This script checks the contents of the Conclusion field when the user exits the field. If Conclusion contains the word "disaster," as in "This project was a complete disaster," the script displays a message to comfort the user.

Sub Exiting(Source As Field)
  Dim workspace As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Set uidoc = workspace.CurrentDocument
  If uidoc.FieldContains( "Conclusion", "disaster" ) Then
    Messagebox( "Sorry to hear it." )
  End If
End Sub