IMsgStore::FinishedMsg

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Enables the message store provider to perform processing on a sent message. This method is called only by the MAPI spooler.

HRESULT FinishedMsg(
  ULONG ulFlags,
  ULONG cbEntryID,
  LPENTRYID lpEntryID
);

Parameters

  • ulFlags
    [in] Reserved; must be zero.

  • cbEntryID
    [in] The byte count in the entry identifier pointed to by the lpEntryID parameter.

  • lpEntryID
    [in] A pointer to the entry identifier of the message to be processed.

Return Value

  • S_OK
    Processing on the sent message was successful.

  • MAPI_E_NO_SUPPORT
    The message store provider does not support sent message processing. This error value is returned if the caller is not the MAPI spooler.

Remarks

The IMsgStore::FinishedMsg method performs processing on a sent message. This processing can involve deleting the message, moving it to a different folder, or both actions. The type of processing depends on whether the PR_DELETE_AFTER_SUBMIT (PidTagDeleteAfterSubmit) and PR_SENTMAIL_ENTRYID (PidTagSentMailEntryId) properties are set.

Notes to Implementers

In your implementation of FinishedMsg, unlock the message identified by lpEntryID and perform the appropriate processing. The target message will always be locked; the MAPI spooler never passes the entry identifier for an unlocked message to FinishedMsg.

It is possible that neither PR_DELETE_AFTER_SUBMIT or PR_SENTMAIL_ENTRYID is set, both are set, or one or the other is set. The following table describes the action you should take based on the settings:

If neither property is set:

Leave the message in the folder from which it was sent (typically the Outbox).

If both properties are set:

Move the message to the indicated folder, if desired, and then delete it.

If PR_SENTMAIL_ENTRYID is set:

Move the message to the indicated folder.

If PR_DELETE_AFTER_SUBMIT is set:

Delete the message.

After you have taken whatever action is appropriate, call the IMAPISupport::DoSentMail method.

See Also

Reference

IMAPISupport::DoSentMail

IMsgStore : IMAPIProp