如何用vb播放幻灯片

来源:互联网 发布:linux apache php7 编辑:程序博客网 时间:2024/04/30 05:03

如何让幻灯片在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

原创粉丝点击