vba - 我可以在 PowerPoint VBA 中使用“ActivePresentation”的替代方法还有哪些其他方法
问题描述
我目前正在研究 PowerPoint VBA 并编写代码以便能够复制第一张幻灯片并将其再次粘贴到同一个演示文稿中。但是,我不断收到错误“剪贴板为空或包含可能不会在此处发布的数据”,根据 Microsoft 页面,问题是使用“ActivePresentation”
我正在寻找另一种方法来引用我在不使用 ActivePresentation 的情况下打开的幻灯片。有什么帮助吗?想法?
我使用 ActivePresentation 的代码行如下:
ActivePresentation.Slides(1).Copy
ActivePresentation.Slides.Paste(ActivePresentation.Slides.Count=1)
解决方案
不要复制,复制
Dim NewSlide as Slide
Set newSlide = ActivePresentation.Slides(1).Duplicate
NewSlide.MoveTo toPos:=4 'move it to become the fourth slide
推荐阅读
- android - 程序类型已存在:com.dropbox.core.BadResponseCodeException
- javascript - 使用 boost 模块时,Highcharts 注释不起作用
- google-sheets - 很难为这种情况创建公式
- sql - SQL Server - WHERE子句中除以零错误(即使条件除数> 0)
- ios - iOS Swift:条件绑定的初始化程序必须具有 Optional 类型,而不是 '() -> String?
- c# - 实体框架插入具有相同类型和 id 的多个导航属性的对象
- akka - Thingsboard 中的演员模型
- android - 如何使用rest api调用单击上一个按钮后保持复选框状态
- c# - Linq 除了忽略自定义比较器?
- sql - 内部联接查询不检索最新结果