Start a slide show from a specific slide

The following VBA code demonstrates how start a slide show from a specific slide:

Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function LockWindowUpdate Lib "user32" ( _
    ByVal hwndLock As Long) As Long

Sub LaunchSlideShowFromSlide(ByVal Pres As Presentation, _
    ByVal SlideIndex As Long)

    On Error Resume Next

    LockWindowUpdate GetDesktopWindow()
    With Pres.SlideShowSettings.Run
        .View.GotoSlide SlideIndex
    End With
    LockWindowUpdate 0
End Sub

Sub Test()
    LaunchSlideShowFromSlide ActivePresentation, 3
End Sub

Contact OfficeOne on email at Copyright © 2001-2023 OfficeOne. All rights reserved.