Class PlaySoundRuleAction (Outlook VBA)

The class PlaySoundRuleAction represents an action that plays a .wav file sound. To use a PlaySoundRuleAction class variable it first needs to be instantiated, for example


Dim psr as PlaySoundRuleAction
Set psr = Session.DefaultStore.GetRules(1).Actions

ActionType

Returns a constant, olRuleActionPlaySound, 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 sound playing 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.PlaySound.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.PlaySound.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.PlaySound.Enabled = True

FilePath

Returns or sets a String that represents the full file path to a sound file (.wav).

Returns an error if the path is invalid.


Session.DefaultStore.GetRules(1).Actions.PlaySound.FilePath =

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: