IMAPIContainer::GetContentsTable
Last modified: July 23, 2011
Applies to: Outlook
In this article
Notes to Implementers
Notes to Callers
MFCMAPI Reference
Returns a pointer to the container's contents table.
HRESULT GetContentsTable( ULONG ulFlags, LPMAPITABLE FAR * lppTable );
The IMAPIContainer::GetContentsTable method returns a pointer to the contents table of a container. A contents table contains summary information about objects in the container.
Contents tables have lengthy column sets. For a complete list of the required and optional columns in contents tables, see Contents Tables.
It is possible for some containers to have no contents. These containers return MAPI_E_NO_SUPPORT from their implementations of GetContentsTable.
If you support a contents table for your container, you must also do the following:
-
Support calls to the container's IMAPIProp::OpenProperty method to open the PR_CONTAINER_CONTENTS (PidTagContainerContents) property.
-
Return PR_CONTAINER_CONTENTS in response to a call to the container's
IMAPIProp::GetProps and IMAPIProp::GetPropList methods.
A remote transport provider's implementation of this method must return a pointer to an IMAPITable : IUnknown interface in the ppTable parameter passed into the GetContentsTable method. If your transport provider has an existing contents table, it is sufficient to return a pointer to it. If not, this method must create a new IMAPITable : IUnknown object, populate the table with message headers (if any are available), and return a pointer to the new table. The ITableData::HrGetView method is useful for generating a return value and storing the table pointer in the ppTable parameter. The contents table must support at least the following property columns:
-
PR_ENTRYID (PidTagEntryID)
-
PR_SENDER_NAME (PidTagSenderName)
-
PR_SENT_REPRESENTING_NAME (PidTagSentRepresentingName)
-
PR_DISPLAY_TO (PidTagDisplayTo)
-
PR_SUBJECT (PidTagSubject)
-
PR_MESSAGE_CLASS (PidTagMessageClass)
-
PR_MESSAGE_FLAGS (PidTagMessageFlags)
-
PR_MESSAGE_SIZE (PidTagMessageSize)
-
PR_PRIORITY (PidTagPriority)
-
PR_IMPORTANCE (PidTagImportance)
-
PR_SENSITIVITY (PidTagSensitivity)
-
PR_MESSAGE_DELIVERY_TIME (PidTagMessageDeliveryTime)
-
PR_MSG_STATUS (PidTagMessageStatus)
-
PR_MESSAGE_DOWNLOAD_TIME (PidTagMessageDownloadTime)
-
PR_HASATTACH (PidTagHasAttachments)
-
PR_OBJECT_TYPE (PidTagObjectType)
-
PR_INSTANCE_KEY (PidTagInstanceKey)
-
PR_NORMALIZED_SUBJECT (PidTagNormalizedSubject)
String and binary contents table columns can be truncated. Typically, providers return 255 characters. Because you cannot know beforehand whether a table includes truncated columns, assume that a column is truncated if the length of the column is either 255 or 510 bytes. You can always retrieve the full value of a truncated column, if necessary, directly from the object by using its entry identifier to open it and then calling the IMAPIProp::GetProps method.
Depending on the provider's implementation, restrictions and sorting operations can apply to all of a string or to the truncated version of that string.