Class NewItemAlertRuleAction (Outlook VBA)

The class NewItemAlertRuleAction represents an action that displays a new item alert to the user. To use a NewItemAlertRuleAction class variable it first needs to be instantiated, for example


Dim nia as NewItemAlertRuleAction
Set nia = Session.DefaultStore.GetRules(1).Actions

ActionType

Returns a constant, olRuleActionNewItemAlert, from the OlRuleActionType enumeration that indicates the type of action that is taken by the rule. Here you can find possible values for OlRuleActionType.

The new item alert 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.NewItemAlert.ActionType

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).Actions.NewItemAlert.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.NewItemAlert.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:

Text

Returns or sets a String that represents the text displayed in the new item alert dialog box.

Returns an error if the text is an empty string.


Session.DefaultStore.GetRules(1).Actions.NewItemAlert.Text =