WindowBeforeDoubleClick Event Example

In slide sorter view, the default double-click event for any slide is to change to slide view. In this example, if the active presentation is displayed in slide sorter view, the default action is preempted by the WindowBeforeDoubleClick event. The event procedure changes the view to normal view and then cancels the change to slide view by setting the Cancel argument to True.

Private Sub App_WindowBeforeDoubleClick _
        (ByVal Sel As Selection, ByVal Cancel As Boolean)
    With Application.ActiveWindow
        If .ViewType = ppViewSlideSorter Then
           .ViewType = ppViewNormal
            Cancel = True
        End If
    End With
End Sub