Application.SlideSelectionChanged event (PowerPoint)
Occurs at different times depending on the current view.
Syntax
expression. SlideSelectionChanged
( _SldRange_
)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
SldRange | Required | SlideRange | The selection of slides. In most cases this would be a single slide (for example, in Slide View you navigate to the next slide), but in some cases this could be multiple slides (for example, a marquee selection in Slide Sorter View). |
Remarks
To access the Application events, declare an Application variable in the General Declarations section of your code. Then set the variable equal to the Application object for which you want to access events. For information about using events with the Microsoft PowerPoint Application object, see How to: Use Events with the Application Object.
The following table describes when the event occurs in each of the views.
View | Description |
---|---|
Normal, Master | Occurs when the slide in the slide pane changes. |
Slide Sorter | Occurs when the selection changes. |
Slide, Notes | Occurs when the slide changes. |
Outline | Does not occur. |
Example
This example displays a message every time a user selects a different slide. This example assumes that an Application object called PPTApp has been declared by using the WithEvents keyword.
Private Sub PPTApp_SlideSelectionChanged(ByVal SldRange As SlideRange)
MsgBox "Slide selection changed."
End Sub
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.