Class AccountRuleCondition (Outlook VBA)

The class AccountRuleCondition represents a rule condition that evaluates whether an account was used to send a message. To use a AccountRuleCondition class variable it first needs to be instantiated, for example


Dim arc as AccountRuleCondition
Set arc = Session.DefaultStore.GetRules(1).Exceptions

Account

Returns or sets an Account object that represents the account used to evaluate the rule condition.

Returns an error if account does not represent an initialized account.


Session.DefaultStore.GetRules(1).Exceptions.Account.Account =

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.Account.Class

ConditionType

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

The account 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.Account.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 has been saved successfully.


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

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: