Share via


Synchronizing Text and Formatting

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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.