Class ActionSetting (PowerPoint VBA)
Contains information about how the specified shape or text range reacts to mouse actions during a slide show. To use a ActionSetting class variable it first needs to be instantiated, for example
Dim asg as ActionSetting
Set asg = ActiveWindow.RangeFromPoint.ActionSettings(Index:=1)
Action
Returns or sets the type of action that will occur when the specified shape is clicked or the mouse pointer is positioned over the shape during a slide show. Here you can find possible values for
The Action property value can be one of the PpActionType constants. You can use the Action property in conjunction with other properties of the ActionSetting object, as shown in the following table.
ActionVerb
Returns or sets a string that contains the OLE verb that will be run when the user clicks the specified shape or passes the mouse pointer over it during a slide show.
The Action property must be set to ppActionOLEVerb first for this property to affect the slide show action.
With ActivePresentation.Slides(1).Shapes(3) _
.ActionSettings(ppMouseOver)
.ActionVerb = "Play"
.Action = ppActionOLEVerb
End With
AnimateAction
Specifies whether the color of the specified shape is momentarily inverted when the specified mouse action occurs.
The value of the AnimateAction property can be one of these MsoTriState constants.
With ActivePresentation.Slides(1) _
.Shapes(3).ActionSettings(ppMouseClick)
.SoundEffect.Name = "applause"
.AnimateAction = msoTrue
End With
Hyperlink
Returns a Hyperlink object that represents the hyperlink for the specified shape.
For the hyperlink to be active during a slide show, the Action property must be set to ppActionHyperlink.
With ActivePresentation.Slides(1).Shapes(1) _
.ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.Address = "https://www.microsoft.com/"
End With
Run
Returns or sets the name of the presentation or macro to be run when the specified shape is clicked or the mouse pointer passes over the shape during a slide show.
For this property to affect the slide show action, you must set the Action property value to ppActionRunMacro or ppActionRunProgram. If the value of the Action property is ppActionRunMacro, the specified string value should be the name of a global macro that's currently loaded. If the value of the Action property is ppActionRunProgram, the specified string value should be the full path and file name of a program. You can set the Run property to a macro that takes no arguments or a macro that takes a single Shape or Object argument. The shape that was clicked during the slide show will be passed as this argument.
With ActivePresentation.Slides(1) _
.Shapes(3).ActionSettings(ppMouseOver)
.Action = ppActionRunMacro
.Run = "CalculateTotal"
.AnimateAction = True
End With
ShowAndReturn
Determines if and under what circumstances Microsoft PowerPoint returns to the initiating slide show.
The value of the ShowAndReturn property can be one of these MsoTriState constants.
With ActivePresentation.Slides(1).Shapes(5).ActionSettings(ppMouseClick)
.Action = ppActionNamedSlideShow
.SlideShowName = "techtalk"
.ShowandReturn = msoTrue
End With
SlideShowName
Returns or sets the name of the custom slide show to run in response to a mouse action on the shape during a slide show.
ActiveWindow.RangeFromPoint.ActionSettings(1).SlideShowName =
SoundEffect
Returns a SoundEffect object that represents the sound to be played during the transition to the specified slide.
With ActivePresentation.Slides(1).Shapes(1).AnimationSettings
.Animate = True
.TextLevelEffect = ppAnimateByAllLevels
.SoundEffect.ImportFromFile "c:\bass.wav"
End With