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
-
Call IMessage::GetAttachmentTable to access the message's attachment table.
-
Build a property restriction that limits the table to rows that have PR_RENDERING_POSITION not equal to -1.
-
Call IMAPITable::Restrict to enforce the restriction.
-
Call IMAPITable::SortTable to sort the attachments.
-
Call IMAPITable::QueryRows to retrieve the appropriate rows.
-
Call the message's IMAPIProp::OpenProperty method to retrieve PR_RTF_COMPRESSED with the IStream interface.
-
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.