LOTUSSCRIPT/COM/OLE CLASSES
Examples: Contains method
1. Your project on exotic orchids takes top priority next week, so you want to place all orchid-related mail in the folder "Next week." This script checks a document to see if "Exotic Orchids" is one of its categories; if so, the document is placed in the folder. The document may contain several values in its Categories item; as long as one of the values matches "Exotic Orchids," the Contains method returns True.
Set category = memo.GetFirstItem( "Categories" )
If category.Contains( "Exotic Orchids" ) Then
Call memo.PutInFolder( "Next week" )
End If
2. This script shows an incorrect use of Contains. It categorizes a document based on the contents of its Subject. If the memo's Subject item is "Here's my status report," the Contains method returns False because the values "Here's my status report" and "status" do not match.
Dim doc As NotesDocument
Dim item As NotesItem
'...set value of doc...
Set item = doc.GetFirstItem( "Subject" )
If item.Contains( "status" ) Then
doc.Categories = "Status reports"
Call doc.Save( True, True )
End If
See Also
Contains method
Glossary
Feedback on
Help
or
Product Usability
?
Help on Help
All Help Contents
Glossary