Share via


WindowSelectionChange Event

Occurs when the selection of text, a shape, or a slide in the active document window changes, whether through the user interface or through code.

Private Subapplication**_WindowSelectionChange(ByValSelAs Selection)**

*application    * An object of type Application declared with events in a class module. For information about using events with the Application object, see Using Events with the Application Object .

*Sel    * Represents the object selected.

Example

This example determines when a different slide is being selected and changes the background color of the newly selected slide.

Private Sub App_WindowSelectionChange(ByVal Sel As Selection)
    With Sel
        If .Type = ppSelectionNone Then
            With .SlideRange(1)
                .ColorScheme.Colors(ppBackground).RGB = _
                    RGB(240, 115, 100)
            End With
        End If
    End With
End Sub

Applies to | Application Object