Platform SDK: Exchange Server

Opening the Favorites Folder

The visibility of the All Public Folders folder and the Favorites folder differs according to the way they are sought. When an application opens the IPM_SUBTREE folder by first obtaining the MAPI PR_IPM_SUBTREE_ENTRYID property and then obtaining the hierarchy table at this level, the Favorites and All Public Folders folders appear in the hierarchy table.

But when an application directly traverses the hierarchy table beginning with the root folder of the public information store, the Favorites folder and the All Public Folders folder do not appear in the hierarchy table. The subfolders of the All Public Folders folder appear in the hierarchy directly under the IPM_SUBTREE folder.

To open the Favorites folder or the All Public Folders folder directly, use the PR_IPM_PUBLIC_FOLDERS_ENTRYID and PR_IPM_FAVORITES_ENTRYID properties on the public information store object. This method for opening the Favorites folder is described in the following procedure. For more information, see About the Favorites Folder.

To open the Favorites folder using HrOpenExchangePublicStore

  1. Open the public information store by calling the HrOpenExchangePublicStore function. This function call returns an lpMDB pointer to the open store, which also gives you access to the MAPI IMsgStore interface.
  2. Use the IMAPIProp::GetProps method to read the PR_IPM_FAVORITES_ENTRYID property, which contains the entry identifier of the Favorites folder.
  3. Open the Favorites folder within the public information store by calling the MAPI IMsgStore::OpenEntry method. In this function call, pass the entry identifier of the folder in the lpEntryID parameter.

To open the Favorites folder using HrMAPIOpenFolderEx

Open the Favorites folder by calling the HrMAPIOpenFolderEx function. In this function call, pass the entry identifier of the Favorites folder as follows: @PR_IPM_FAVORITES_ENTRYID.

For a list of other entry identifiers for special folders, see Entry Identifiers of Special Folders.