Setting Up a Search Folder

The client creates a search folder by using the RopCreateFolder ROP ([MS-OXCROPS] section with the FolderType field set to the value 2, as specified in section For details about creating a folder, see section

The client fills a search folder by applying search criteria and a search scope to the search folder. The search criteria determine which messages are included in the folder, and the search scope determines the folders that are searched.

To set the search criteria and search scope for a search folder, the client sends a RopSetSearchCriteria ROP request ([MS-OXCROPS] section with bits of the SearchFlags field set to control the details of how the search is performed, as specified in section The ROP request includes restrictions to specify the search criteria and FIDs ([MS-OXCDATA] section to specify the search scope. A search folder cannot be included in its own search scope. Therefore, the FolderIds field MUST NOT include the FID of the search folder.

To access the results of a search, the client sends a RopGetContentsTable ROP request ([MS-OXCROPS] section to obtain the contents table of the search folder, as specified in section The messages that match the search criteria are specified in the table.

When the client is finished using a search folder, the folder can either be deleted or remain open for later use. Note that if the search folder is deleted, only message links are deleted. The actual messages remain in their parent folders.