Opening an Address Book Container

After opening the MAPI integrated address book, open one or more address book containers to access the recipients within them.

To open the top-level container of the address book, call IAddrBook::OpenEntry with a NULL entry identifier.

Address book containers can be implemented with read-only or read/write access. Read-only containers are used only for browsing. Read/write containers can be modified, allowing clients to create new entries and delete and modify existing entries. All personal address book (PAB) containers are implemented as read/write containers.

To open any lower level container, call OpenEntry and specify the entry identifier of the container to be opened.

    To open the container designated as the PAB
  1. Call IAddrBook::GetPAB to retrieve the PAB's entry identifier.
  2. Pass this entry identifier to IAddrBook::OpenEntry.
    To open a container that is not the PAB
  1. Call IAddrBook::OpenEntry with a NULL entry identifier to open the address book's root container.
  2. Call the root container's IMAPIContainer::GetHierarchyTable method to retrieve its hierarchy table — a list of all of the top-level containers in the address book.
  3. If the container to be opened is of a specific type:
·    DT_GLOBAL to limit the hierarchy table to containers that belong in the global address list.
·    DT_LOCAL to limit the table to containers belonging to a local address book.
·    DT_MODIFIABLE to limit the table to containers that can be modified.

  1. If the container to be opened belongs to a specific address book provider: