This documentation is archived and is not being maintained.


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.

Sets the status associated with a message (for example, whether that message is marked for deletion).

HRESULT SetMessageStatus(
  ULONG cbEntryID,
  ULONG ulNewStatus,
  ULONG ulNewStatusMask,
  ULONG FAR * lpulOldStatus


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


[in] A pointer to the entry identifier for the message whose status is set.


[in] The new status to be assigned.


[in] A bitmask of flags that is applied to the new status and indicates the flags to be set. The following flags can be set:


The message has been marked for deletion.


The message is not to be displayed.


The message is to be displayed highlighted.


The message has been marked for deletion at the remote message store without downloading to the local client.


The message has been marked for downloading from the remote message store to the local client.


The message has been tagged for a client-defined purpose.


[out] A pointer to the previous status of the message.


The message status was successfully set.

The IMAPIFolder::SetMessageStatus method sets the message status to the value that is stored in its PR_MSG_STATUS (PidTagMessageStatus) property.

How the message status bits are set, cleared, and used depends completely on your implementation, except that bits 0 through 15 are reserved and must be zero.

A remote transport provider's implementation of this method must follow the semantics described here. There are no special considerations. Clients use this method to set the MSGSTATUS_REMOTE_DOWNLOAD and MSGSTATUS_REMOTE_DELETE bits to indicate that a particular message is to be downloaded or deleted from the remote message store. A remote transport provider does not have to implement the related IMAPIFolder::GetMessageStatus method. Clients must look in the folder's contents table to determine the status of a message.

You can use the PR_MSG_STATUS property of a message to negotiate a message lockout operation with other clients. Designate a bit as the lockout bit. To determine whether the lockout bit was set, examine the previous value for message status in the lpulOldStatus parameter. Use the other bits in the ulNewStatus parameter to track message status without interfering with the lockout bit.