Class SenderInAddressListRuleCondition (Outlook VBA)

The class SenderInAddressListRuleCondition represents a rule condition that the sender's address is in the address list specified in AddressRuleCondition.Address. To use a SenderInAddressListRuleCondition class variable it first needs to be instantiated, for example


Dim sia as SenderInAddressListRuleCondition
Set sia = Session.DefaultStore.GetRules(1).Exceptions

AddressList

Returns or sets an AddressList object that represents the address list used to evaluate the rule condition.

Returns an error if the AddressList object does not represent an initialized AddressList object.


Session.DefaultStore.GetRules(1).Exceptions.SenderInAddressList.AddressList =

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

ConditionType

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

The rule condition that the sender must be in the address list is supported only by rules for receiving messages. For more information, see Specify Rule Conditions.


Dim orcConditionType As OlRuleConditionType
orcConditionType = Session.DefaultStore.GetRules(1).Exceptions.SenderInAddressList.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.SenderInAddressList.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: