以编程方式将多个演示文稿中的幻灯片合并为一个演示文稿
我需要自动创建演示文稿(OpenOffice 或 Powerpoint)。演示文稿应采用给定目录中每个演示文稿的前两张幻灯片,然后将它们组合成一个演示文稿。我很困惑应该采取什么方法来解决这个问题。任何指示将不胜感激。
I need to automate the creation of a presentation (either OpenOffice or Powerpoint). The presentation should take the first two slides of each of the presentations in a given directory, and then combine them into a single presentation. I'm confused as to what approach I should take to solve this. Any pointers will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
谈到 PowerPoint,您将使用 VBA 宏来完成这项工作,例如
选择源目录,您
现在可以使用此功能 - 要点是插入另一个 PPT 中的幻灯片,同时保留源格式。这是一件棘手的事情,因为 PPT VBA
InsertFromFile
方法没有什么用处。 Microsoft 为我们提供了很好的时间,让我们在无数 20 小时的调试会话中艰难地解决这个问题:-),并且您需要键入大量代码才能正确完成它 - 比手动使用对话复杂得多,特别是如果您的源幻灯片与您的源母版幻灯片不同。如果您的 PPT 坚持其母版,您可以安全地省略“>>”之间的所有代码
该代码不会检查只读或受密码保护的文件,并且会在它们上崩溃。还要注意不要运行收集器文件本身。否则它应该有效。我必须承认我已经很长时间没有检查代码了;-)
Talking about PowerPoint, you would use a VBA Macro to do the job, something like
Selecting your source directory you can use this function
Now - the main point is inserting slides from another PPT while preserving the source format. This is a tricky thing, as the PPT VBA
InsertFromFile
method is of no good use. Microsoft gave us good time to figure it out the hard way in countless 20hrs debuging sessions :-) and you need to type a lot of code to get it done correctly - far more complicated than using the dialogue manually, in particular if your source slide deviates from your source master slide.If your PPT's are sticking to their masters, you can safely omit all code between the ">>>>"
The code doesn't check for read-only or password protected fies and will crash on them. Also be careful not to run over the collector file itself. Otherwise it should work. I must admit I haven't reviewed the code for a long time ;-)
您可以通过谷歌搜索“powerpoint join”来找到一个有用的工具来连接多个ppt。
You can google "powerpoint join" to find a useful tool to join many ppts.
我很高兴 @miked 能够为您提供所需的东西。
如果使用 .NET,则需要考虑另一种方法,这篇文章中进行了讨论
I'm glad @miked was able to get you what you needed.
Another method to consider, if using .NET, is discussed in this post
一个简单快速的解决方案:
注意:
X 是在演示文稿中插入幻灯片的位置
I 是插入幻灯片的实际位置
代码是用 Delphi/Pascal 编写的,但您可以轻松转换它......
A simple and fast solution:
Note:
X is place to insert slide in presentation
I is actual place where slide was inserted
Code is written in Delphi/Pascal but you can convert it easelly ...
您可以使用 Aspose.Slides for .NET 来完成此操作。它甚至允许将 OpenOffice 和 PowerPoint 演示文稿连接在一起。查看本文。
You can do this with Aspose.Slides for .NET. It even allows joining OpenOffice and PowerPoint presentations together. View this article.