Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Provides access to the message store table that contains information about all the message stores in the session profile.

HRESULT GetMsgStoresTable(
  ULONG ulFlags,


[in] A bitmask of flags that determines the format for columns that are character strings. The following flag can be set:


The string columns are in Unicode format. If the MAPI_UNICODE flag is not set, the string columns are in ANSI format.


[out] A pointer to a pointer to the message store table.


The table was successfully returned.


The MAPI_UNICODE flag was set and the session does not support Unicode.

The IMAPISession::GetMsgStoresTable method retrieves a pointer to the message store table, a table maintained by MAPI that contains information about each open message store in the profile.

For a complete list of required and optional columns in the message store table, see Message Store Tables.

Because MAPI updates the message store table during the session whenever changes occur, call the Advise method of the message store table to register to be notified of these changes. Possible changes include the addition of new message stores, removal of existing stores, and changes to the default store.

Setting the MAPI_UNICODE flag in the ulFlags parameter affects the format of the columns returned from the IMAPITable::QueryColumns and IMAPITable::QueryRows methods. This flag also controls the property types in the sort order returned by the IMAPITable::QuerySortOrder method.

For MFCMAPI sample code, see the following table.






MFCMAPI uses the IMAPISession::GetMsgStoresTable method to obtain the message store table so that it can be rendered in the main dialog box of MFCMAPI.

© 2015 Microsoft