Selecting MAPI Methods That Use Fewer RPCs

The following table lists a number of commonly used MAPI methods and the circumstances under which they cause RPCs. To optimize your application’s performance, use the MAPI methods that cause the fewest RPCs.

Commonly Used MAPI Methods and RPCs

MAPI Method Causes RPC?
Advise Never causes an RPC.
CompareEntryIDs Very rarely causes an RPC.
CopyTo Always causes an RPC.
CreateAttachment Causes an RPC except when creating the first message and the MAPI_DEFERRED_ERRORS flag is set.
CreateBookmark Causes an RPC except when creating a bookmark for the beginning or end of a table.
CreateFolder Always causes an RPC.
CreateMessage Causes an RPC except when MAPI_DEFERRED_ERRORS is is set.
DeleteProps Causes an RPC for information store and folder objects, rarely for most other objects.
FindRow Always causes an RPC, but retrieves extra information to save for subsequent calls of the QueryRows method, which can minimize future RPCs.
DeleteMessages Always causes an RPC.
FreeBookmark Never causes an RPC.
GetAttachmentTable Causes an RPC except when MAPI_DEFERRED_ERRORS is set.
GetContentsTable Causes an RPC except when MAPI_DEFERRED_ERRORS is set.
GetHierarchyTable Causes an RPC except when MAPI_DEFERRED_ERRORS is set.
GetIDsFromNames Usually causes an RPC unless the identifier is already in the cache (identifiers are cached locally after the first call).
GetNamesFromIDs Usually causes an RPC, unless the name is already in the cache (names are cached locally after the first call).
GetProps Causes an RPC unless properties are stored locally
GetRecipientTable Causes an RPC except with MAPI_DEFERRED_ERRORS set.
GetRowCount Usually causes an RPC, except when table properties are cached by provider.
OpenEntry Causes an RPC except with MAPI_DEFERRED_ERRORS set.
OpenMsgStore Always causes an RPC.
OpenProperty Depends on the property. Never causes an RPC if MAPI_DEFERRED_ERRORS is set.
QueryColumnsAll Causes an RPC for contents, attachment, and recipient tables. Never causes an RPC for all other tables.
QueryPosition Usually causes an RPC, with a few exceptions (such as at the beginning and end of a table).
QueryRows Usually causes an RPC. Never causes an RPC when used after FindRow (on same row) or when already at end of table.
QuerySortOrder Never causes an RPC.
Release Causes an RPC only for an information store object. Never causes an RPC for all other objects.
Restrict Causes an RPC only if called before data is in the cache. Does not when passed NULL on already nonrestricted table.
SaveChanges Causes an RPC except with MAPI_DEFERRED_ERRORS set, although using MAPI_DEFERRED_ERRORS is not usually recommended.
SeekRow Usually causes an RPC except when already at the row, seeking to the end, or seeking to the beginning.
SetColumns Causes an RPC only if called before data is in cache.
SetProps Causes an RPC for information store and folder objects, rarely for most other objects.
SortTable Causes an RPC only if called before data is in the cache.
SubmitMessage Always causes an RPC.