【问题标题】:How to open a PowerPoint slide using Excel VBA?如何使用 Excel VBA 打开 PowerPoint 幻灯片?
【发布时间】:2022-12-23 17:37:08
【问题描述】:
Sub Day1()

Dim objPPT As Object

Set objPPT = CreateObject("PowerPoint.Application")
Set PowerPoint.Slide = 5
objPPT.Visible = True

objPPT.Presentations.Open "C:\Users\Me\Desktop\Macro Test\Day 1.pptx"

End Sub

我希望它能打开我的 PowerPoint 演示文稿中的第五张幻灯片。

【问题讨论】:

    标签: vba powerpoint


    【解决方案1】:

    您的示例代码几乎是正确的。只需要使用正确的对象,然后选择幻灯片。

    Dim objPPT As Object
    Set objPPT = CreateObject("PowerPoint.Application")
    
    objPPT.Visible = True
    
    objPPT.Presentations.Open("your file")
    
    objPPT.Slides(5).Select
    

    【讨论】:

    • 或者使用 ActiveWindow.View.GoToSlide(5)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多