Rendering an Attachment in Formatted Text

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 property:

\objattph
 
    To locate rendering information in formatted text
  1. Call IMessage::GetAttachmentTable to access the message's attachment table.
  2. Build a property restriction that limits the table to rows that have PR_RENDERING_POSITION not equal to -1.
  3. Call IMAPITable::Restrict to enforce the restriction.
  4. Call IMAPITable::SortTable to sort the attachments.
  5. Call IMAPITable::QueryRows to retrieve the appropriate rows.
  6. Call the message's IMAPIProp::OpenProperty method to retrieve PR_RTF_COMPRESSED with the IStream interface.
  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.