Start PowerPoint Slide Show from Visual Basic

The following Visual Basic code demonstrates how start a slide show by automating PowerPoint.

See Also: RunSlideShow

Sub StartSlideShow(ByVal FileName As String)
    Dim PPT As Object
    Dim Pres As Object

    On Error Resume Next

    Set PPT = CreateObject("PowerPoint.Application")
    Set Pres = PPT.Presentations.Open(FileName, False, False, False)
    If Pres.SlideShowWindow Is Nothing Then
        Pres.SlideShowSettings.Run
    End If
End Sub

Contact OfficeOne on email at officeone@officeoneonline.com. Copyright © 2001-2023 OfficeOne. All rights reserved.