Rendering an Attachment in RTF Text

Applies to: Outlook 2013 | Outlook 2016

Rich Text Format (RTF)-aware clients can retrieve rendering position information from RTF message text by looking for the following escape sequence in the message's PR_RTF_COMPRESSED (PidTagRtfCompressed) property:

\objattph

To locate rendering information in formatted text

  1. Call IMessage::GetAttachmentTable to access the message's attachment table. For more information, see IMessage::GetAttachmentTable.

  2. Build a property restriction that limits the table to rows that have PR_RENDERING_POSITION not equal to -1. For more information, see PR_RENDERING_POSITION (PidTagRenderingPosition).

  3. Call IMAPITable::Restrict to enforce the restriction. For more information, see IMAPITable::Restrict.

  4. Call IMAPITable::SortTable to sort the attachments. For more information, see IMAPITable::SortTable.

  5. Call IMAPITable::QueryRows to retrieve the appropriate rows. For more information, see IMAPITable::QueryRows.

  6. Call the message's IMAPIProp::OpenProperty method to retrieve PR_RTF_COMPRESSED with the IStream interface. For more information, see IMAPIProp::OpenProperty and PR_RTF_COMPRESSED.

  7. Scan the stream, looking for the rendering placeholder, \objattph. The character following this placeholder is the place for the next attachment in the sorted table.