将一张幻灯片复制到多个演示文稿

编程入门 行业动态 更新时间:2024-10-09 21:21:51
本文介绍了将一张幻灯片复制到多个演示文稿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的任务是将一张幻灯片复制到多个 ppt 演示文稿.所有ppt都在同一个文件夹中.我不知道如何开始.到目前为止,我已经用 VBA 更改了一些简单的东西,如更改字体、标题等.有人可以帮助我吗?提前致谢

I have task to copy one slide to multiple ppt presentations. All ppts are in same folder. I don't have an idea how to start. So far I have change some simple stuff with VBA as changing font, title etc. Anybody can help me? Thanks in advance

推荐答案

使用采用这种形式的 InsertSlideFromFile 方法:

Use the InsertSlideFromFile method which takes this form:

.InsertFromFile(FileName, Index, SlideStart, SlideEnd)

示例.要从 test.pptx 复制幻灯片 3 到 4 并将它们粘贴到当前打开的演示文稿(ActivePresentation)的末尾:

Example. To copy slides 3 to 4 from test.pptx and paste them to the end of your currently open presentation (the ActivePresentation):

' VBA macro to insert slide(s) from file ' Written by Jamie Garroch of youpresent.co.uk/ Sub InsertSlides() With ActivePresentation.Slides .InsertFromFile "test.pptx", .Count, 3, 4 End With End Sub

如果所有文件都在与打开的演示文稿相同的路径上,您可以通过以下方式自动设置路径:

If all files are on the same path as the open presentation, you can automate the path by starting with this:

Dim myPath as String MyPath = ActivePresentation.Path

这里有关于 InsertSlideFromFile 方法的更多信息:

More info on the InsertSlideFromFile method here:

msdn.microsoft/en-us/library/office/ff746047.aspx?f=255&MSPPError=-2147217396

更多推荐

将一张幻灯片复制到多个演示文稿

本文发布于:2023-10-31 10:14:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545780.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   幻灯片   演示文稿

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!