Platform SDK: MAPI

Tracking Conversations

Conversation tracking is collecting responses to a message. Clients should set two properties that aid in tracking conversations:

PR_CONVERSATION_TOPIC

PR_CONVERSATION_INDEX

PR_CONVERSATION_TOPIC is the normalized subject of the message, the subject without the prefix strings. Set this property to the value of the message's PR_NORMALIZED_SUBJECT property.

PR_CONVERSATION_INDEX indicates the position of the message within a particular conversation. It is a client's reponsibility to set PR_CONVERSATION_INDEX for each outgoing message, whether it is a new message, a forwarded message, or a reply. Clients can set this property manually or call ScCreateConversationIndex, a utility function provided by MAPI.

ScCreateConversationIndex generates the value of a conversation index for any outgoing message. ScCreateConversationIndex implements the index as a header block that is 22 bytes in length, followed by zero or more child blocks each 5 bytes in length.

The header block is composed of 22 bytes, divided into three parts:

If you choose to set the conversation indexes of messages manually, consider the following suggestions:

  1. Keep differences in the respondents' time zones transparent; use UTC times rather than local time.
  2. Indent each conversation group by the same amount.
  3. Sort responses to the same message date.
  4. Separate threads started at different times that happen to share the same topic.
  5. To implement a categorized sort so that messages are grouped by topic, sort by PR_CONVERSATION_TOPIC first and then by PR_CONVERSATION_INDEX. To present the results of the sort, set the PR_DEPTH property to 0 for messages with a conversation index that is 22 bytes in length. Then, for every 5-byte increment in the length, increment the value of the PR_DEPTH property by one.

The PR_ORIGINAL group of properties can also be used for conversation tracking. Set these properties to link reply or forwarded messages to the original message. All of the PR_ORIGINAL properties are optional. If you do not explicitly set, for example, PR_ORIGINAL_AUTHOR_ENTRYID, the message store provider can use the default value, or the value of the PR_SENDER_ENTRYID property. Likewise, if you do not set PR_ORIGINAL_AUTHOR_NAME or PR_ORIGINAL_SUBMIT_TIME, these properties can default to the values of the PR_SENDER_NAME and PR_CLIENT_SUBMIT_TIME properties, respectively.