Opening an Existing Public Folder

Public folders are located in the Microsoft Exchange Server public information store, which is a portion of the information store. Therefore, before you can access public folders, you must locate and open the public information store.

You can open an existing folder if you know either its entry identifier or a path to the folder, including the value of its Display-Name property. It is faster if you use the entry identifier to open the folder, if you know it. Also, folder paths or names may change, so reusing a path to a folder that once worked may fail. A folder’s entry identifier remains the same, so using it should work reliably.

    To open an existing public folder using the HrOpenExchangePublicFolders function
  1. Open the public information store by calling the HrOpenExchangePublicStore function. For more information, see Opening a Public Information Store.
  2. Open the All Public Folders container by calling the HrOpenExchangePublicFolders function and passing the LPMDB pointer to the public information store. This returns an LPMAPIFOLDER pointer to the open folder.
  3. Call either the HrMAPIFindSubfolderEx function or the HrMAPIOpenSubfolderEx function. In each case, pass both the pointer returned in step 2 and the path to the folder, as described in Expressing Paths to Folders.

    The HrMAPIFindSubfolderEx function returns the entry identifier of the folder, which you can use to open it later. The HrMAPIOpenSubfolderEx function locates the folder and opens it for you.

    To open an existing public folder using the HrMAPIOpenFolderEx function
  1. Open the public information store by calling the HrOpenExchangePublicStore function. For more information, see Opening a Public Information Store.
  2. Open the IPM_SUBTREE folder by calling the HrMAPIOpenFolderEx function, and passing either a folder path or folder name. For more information, see Expressing Paths to Folders.

    This call returns an LPMAPIFOLDER pointer to the open folder. At this point, you have opened the All Public Folders container.

  3. Call either the HrMAPIFindSubfolderEx function or the HrMAPIOpenSubfolderEx function. In each case, pass both the pointer returned in step 2 and the path to the folder.

    The HrMAPIFindSubfolderEx function returns the entry identifier of the folder, which you can use to open it later. The HrMAPIOpenSubfolderEx function locates the folder and opens it for you.

Note The Favorites folder can contain only one level of subfolders. These subfolders can contain messages, but not other subfolders.