Export (0) Print
Expand All

Synchronizing Text and Formatting

Last modified: January 16, 2009

Applies to: Office 2010 | Outlook 2010 | Visual Studio

The main challenge in sending Rich Text Format (RTF) messages is keeping the text synchronized with the formatting. To ensure that when messages arrive at their destination they are as their originators intended and that the text and formatting are synchronized, MAPI provides the RTFSync function. RTFSync is typically called by RTF-aware clients before displaying incoming messages and by the MAPI spooler when it downloads messages to a transport provider. Callers specify the area of possible discrepancy by passing one or two flags to RTFSync:

  • RTF_SYNC_BODY_CHANGED to indicate a modification in message text.

  • RTF_SYNC_RTF_CHANGED to indicate a modification in message formatting.

The synchronization process that occurs in RTFSync is a sophisticated cyclic redundancy check (CRC) of the message text that ignores some characters and converts others. Characters that most likely were added by transport providers are ignored. MAPI defines several properties for working with RTF as described in the following table.

RTF property

Description

PR_RTF_SYNC_BODY_TAG (PidTagRtfSyncBodyTag)

Indicates the beginning of the real message text.

PR_RTF_SYNC_BODY_CRC (PidTagRtfSyncBodyCrc)

Contains the result of the cyclic redundancy check of the message text.

PR_RTF_SYNC_BODY_COUNT (PidTagRtfSyncBodyCount)

Contains the number of characters in PR_RTF_SYNC_BODY_CRC.

PR_RTF_IN_SYNC (PidTagRtfInSync)

Set to TRUE when the message text and formatting have been synchronized.

PR_RTF_SYNC_PREFIX_COUNT (PidTagRtfSyncPrefixCount)

Contains the number of nonwhitespace characters that preceed the message text.

PR_RTF_SYNC_TRAILING_COUNT (PidTagRtfSyncTrailingCount)

Contains the number of nonwhitespace characters that trail the message text.

Show:
© 2014 Microsoft