如何用vb播放幻灯片

如何让幻灯片在vb的框架里播放


'Microsoft PowerPoint 9.0(Office 2000的,如果是97则是8.0) Object Library)

''Microsoft PowerPoint 11.0(Office 2003) Object Library)


Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '延时API声明

Private Sub Form_Load()
Dim ppt As New PowerPoint.Application
Dim pres As Presentation

    ppt.Visible = True
    Set pres = ppt.Presentations.Open(App.Path & "/Test.ppt")   '填入你的文件名
    With pres.SlideShowSettings
        .Run
        While pres.SlideShowWindow.View.State <> ppSlideShowDone
            ppt.SlideShowWindows(1).View.Next
            Sleep 1000   '填入延迟的时间调整快慢(毫秒)

        Wend
    End With
    pres.Close
    ppt.Quit
    Set pres = Nothing
    Set ppt = Nothing
End Sub

你可能感兴趣的:(如何用vb播放幻灯片)