MessageFlags Property  
 

Returns one or more flags which identify characteristics of the current message.

Syntax

object.MessageFlags [= flags ]

Remarks

The MessageFlags property returns information about the currently selected message specified by the Message property. The value returned is one or more of the following bit flags:

Value  Value Description
imapFlagNone No flags have been set for the current message
imapFlagAnswered The message has been answered
imapFlagDraft The message is a draft copy and has not been delivered
imapFlagUrgent The message has been flagged for urgent or special attention
imapFlagSeen The message has been read
imapFlagRecent The message has been added to the mailbox recently
imapFlagDeleted The message has been marked for deletion

Setting the MessageFlags property changes the flags for the currently selected message. Multiple bit flags can be combined using the bitwise Or operator. An application can test if a flag is set by using the bitwise And operator.

Data Type

Integer (Int32)

Example

The following example demonstrates how to check the MessageFlags property to see if the message has been marked for deletion, and if it has, to clear the flag so that it will not be deleted when the mailbox is unselected:

If (ImapClient1.MessageFlags And imapFlagDeleted) <> 0 Then
    ImapClient1.MessageFlags = ImapClient1.MessageFlags And Not imapFlagDeleted
End If

See Also

Message Property, MessageCount Property, MessagePart Property, MessageParts Property, MessageSize Property, MessageUID Property, GetMessage Method