Displaying the Common Address Dialog Box

The MAPI common address dialog box can be used for a variety of addressing tasks such as constructing a recipient list. To display this dialog box, call IAddrBook::Address. Depending on which of the many parameters you set and how you set them, you can limit your display to entries of a particular type from a particular container.

    To limit the address dialog box to displaying personal address book (PAB) entries only
  1. Call IAddrBook::GetPAB to retrieve the entry identifier of the PAB.
  2. Create a property restriction that uses RELOP_EQ for the relop member of the SPropertyRestriction structure and either PR_ENTRYID or PR_AB_PROVIDER_ID as the ulPropTag member.

    If you use PR_ENTRYID, pass the entry identifier retrieved from GetPAB. If you use PR_AB_PROVIDER_ID, pass the value included in the MSPAB.H header file. PR_AB_PROVIDER_ID is the unique identifier for the PAB designed by MAPI.

  3. Call IAddrBook::Address with the lpHierRestriction parameter pointing to the property restriction.