用于复制PowerPoint幻灯片的简单代码

问题描述 投票:0回答:1

我正在寻找一个简单的VBA代码,它将执行以下操作:

->打开特定的PowerPoint演示文稿(模板)

->选择一个特定的幻灯片然后复制它

现在我有这个

Sub pres()

Set PowerPointApp = CreateObject("PowerPoint.Application")
PowerPointApp.Presentations.Open "C:\Users\myname\Desktop\test.pptx"
PowerPointApp.Visible = True
ActivePresentation.Slides(8).Duplicate

End Sub

打开演示文稿但不执行任何操作,并向我返回错误429。

有人对如何完成这个非常简单的任务有任何想法吗?

谢谢

excel vba access-vba powerpoint
1个回答
0
投票

[Presentations.Open返回您应捕获的Presentation对象,如下所示:

© www.soinside.com 2019 - 2024. All rights reserved.