IMessage::GetAttachmentTable

Applies to: Outlook 2013 | Outlook 2016

Returns the message's attachment table.

HRESULT GetAttachmentTable(
  ULONG ulFlags,
  LPMAPITABLE FAR * lppTable
);

Parameters

ulFlags

[in] Bitmask of flags that relate to the creation of the table. The following flag can be set:

MAPI_UNICODE

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

MAPI_DEFERRED_ERRORS

Allows GetAttachmentTable to return successfully, possibly before the table is fully available to the calling client. If the table is not available, making a subsequent call to it can cause an error.

lppTable

[out] Pointer to a pointer to the attachment table.

Return value

S_OK

The attachment table was successfully retrieved.

Remarks

The IMessage::GetAttachmentTable method returns a pointer to the message's attachment table, which includes information about all of the attachments in the message. Clients can get access to an attachment only through the attachment table. By retrieving an attachment's number its PR_ATTACH_NUM (PidTagAttachNumber) property a client can use several of the IMessage methods to work with the attachment.

There is one row for each attachment. For a complete list of the columns in an attachment table, see Attachment Tables.

An attachment usually does not appear in the attachment table until both the attachment and the message have been saved with a call to IMAPIProp::SaveChanges. Attachment tables are dynamic. If a client creates a new attachment, deletes an existing attachment, or changes one or more properties once the SaveChanges calls have been made on the attachment on the message, the attachment table will be updated to reflect the new information.

Some attachment tables support a wide variety of restrictions; others do not. Support for restrictions depends on the message store provider's implementation.

When initially opened, attachment tables are not necessarily sorted in any particular order.

Setting the MAPI_UNICODE flag in the ulFlags parameter affects the following calls to the attachment table:

Setting the Unicode flag requests that the information for any string columns returned from these calls be in Unicode format. However, because not all message store providers support Unicode, setting this flag is only a request.

See also

IMessage::CreateAttach

IMessage::DeleteAttach

IMessage::OpenAttach

IMessage : IMAPIProp