Platform SDK: MAPI

Using an Advanced Search Dialog Box

Some address book containers support an advanced searching capability that allows clients to search on properties other than PR_DISPLAY_NAME. Address book containers that support advanced searches have a container object property called PR_SEARCH. This container object provides access to a display table that describes the search dialog box — a dialog box used to enter and edit the advanced search criteria.

To perform an advanced search on an address book container

  1. Call the container's IMAPIProp::OpenProperty method, specifying PR_SEARCH for the property tag and IID_IMAPIContainer for the interface identifier.
  2. Call the search object 's IMAPIProp::OpenProperty method, specifying PR_DETAILS_TABLE for the property tag and IID_IMAPITable for the interface identifier.
  3. Call the search object's IMAPIProp::SetProps method to establish values for the properties to be used in the advanced search.
  4. Call the search object's IMAPIProp::SaveChanges method to save the advanced search criteria.

This sequence of calls results in a restriction being available when a client calls the search object's GetSearchCriteria method.