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
-
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.
-
Use the IMAPIProp::GetProps method to read the PR_IPM_FAVORITES_ENTRYID property, which contains the entry identifier of the Favorites folder.
-
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.
-
Call the HrMAPICreateEntryList function to create an entry list of folders to add.
-
Call the IExchangeFavorites::AddFavorites method, which adds one or more public folders as specified in the ENTRYLIST structure.