Platform SDK: Exchange Server

Adding a Public Folder to Favorites

You can add one or more public folders to a user's Favorites folder by calling the IExchangeFavorites::AddFavorites method. Before you call this method, you must prepare an ENTRYLIST structure to list the public folders to be added.

For more information about ENTRYLIST structures, see the MAPI Programmer's Reference.

To add one or more public folders to a user's Favorites folder

  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 information store by calling the MAPI IMsgStore::OpenEntry method. In this function call, pass the entry identifier of the folder in the lpEntryID parameter. This call returns a pointer to the IExchangeFavorites interface.
  4. Call the HrMAPICreateEntryList function to create an entry list of folders to add.
  5. Call the IExchangeFavorites::AddFavorites method, which adds one or more public folders as specified in the ENTRYLIST structure.