Class SendRuleAction (Outlook VBA)
The class SendRuleAction represents an action that sends a message to one or more recipients. To use a SendRuleAction class variable it first needs to be instantiated, for example
Dim sra as SendRuleAction
Set sra = Session.DefaultStore.GetRules(1).Actions
ActionType
Returns a constant, olRuleActionRedirect, from the OlRuleActionType enumeration that indicates the type of action that is taken by the rule. Here you can find possible values for
The send rule action is supported only by rules for receiving messages. For more information, see Specify Rule Actions.
Dim oraActionType As OlRuleActionType
oraActionType = Session.DefaultStore.GetRules(1).Actions.Forward.ActionType
Class
Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for
Dim oocsClass As OlObjectClass
oocsClass = Session.DefaultStore.GetRules(1).Actions.Forward.Class
Enabled
Returns or sets a Boolean that determines if the rule action is enabled.
After you enable a rule, you must also save the rule by using Rules.Save so that the rule and its enabled state will persist beyond the current session. A rule is only enabled after it has been saved successfully.
Session.DefaultStore.GetRules(1).Actions.Forward.Enabled = True
Recipients
Returns a Recipients collection that represents the recipient list for the send action.
Multiple recipients are evaluated using the logical OR operation.
Dim rcpsRecipients As Recipients
Set rcpsRecipients = Session.DefaultStore.GetRules(1).Actions.Forward.Recipients
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: