Class ImportanceRuleCondition (Outlook VBA)

The class ImportanceRuleCondition represents a rule condition that evaluates the importance of a message. To use a ImportanceRuleCondition class variable it first needs to be instantiated, for example


Dim irc as ImportanceRuleCondition
Set irc = Session.DefaultStore.GetRules(1).Exceptions

Class

Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for OlObjectClass.


Dim oocsClass As OlObjectClass
oocsClass = Session.DefaultStore.GetRules(1).Exceptions.Importance.Class

ConditionType

Returns a constant, olConditionImportance, from the OlRuleConditionType enumeration that indicates the type of rule condition. Here you can find possible values for OlRuleConditionType.

The form name rule condition is supported by rules for receiving messages and rules for sending messages. For more information, see Specify Rule Conditions.


Dim orcConditionType As OlRuleConditionType
orcConditionType = Session.DefaultStore.GetRules(1).Exceptions.Importance.ConditionType

Enabled

Returns or sets a Boolean that determines if the rule condition is enabled.

After you enable a rule condition, you must also save the rule by using Rules.Save so that the rule condition and its enabled state will persist beyond the current session. A rule condition is only enabled after it have been saved successfully.


Session.DefaultStore.GetRules(1).Exceptions.Importance.Enabled = True

Importance

Returns or sets an OlImportance constant indicating the relative level of importance for the message. Possible return values are olImportanceHigh - Item is marked as high importance, olImportanceLow - Item is marked as low importance, olImportanceNormal - Item is marked as medium importance.

This property corresponds to the MAPI property PidTagImportance.


Session.DefaultStore.GetRules(1).Exceptions.Importance.Importance = olImportanceHigh

Session

Returns the NameSpace object for the current session.

The Session property and the GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements perform the same function: