Deleting a Public Folder from Favorites
You can delete one or more public folders from a user’s Favorites folder by calling the IExchangeFavorites::DelFavorites method. Before you call it, you must prepare an ENTRYLIST structure to list the public folders to be deleted. For more information about ENTRYLIST structures, see the MAPI Programmer’s Reference.
To delete one or more public folders from 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 delete.
-
Call the IExchangeFavorites::DelFavorites method, which deletes one or more public folders as specified in the ENTRYLIST structure.