使用 C# 在 PowerPoint 演示文稿中自动播放电影
我目前正在尝试通过 C# 和 Microsoft.Office.Interop.PowerPoint 更改 .pptx 文件中的某些设置。我在演示文稿的几张幻灯片上链接了一些 .wmv 电影。创建演示文稿时,所有电影在单击后都会立即播放。但是,我想将其更改为在查看幻灯片后立即开始自动播放。这必须对很多演示文稿执行此操作,因此无法手动执行此操作。
我找到了 PlaySettings.PlayOnEntry 属性,但我不知道如何使用它。我找到了几个如何嵌入新电影(然后仅适用于 Visual Basic)的示例,但由于电影已经嵌入,这不是我想要的。
我也不知道如何实际访问当前幻灯片上的任何对象,也许有一种方法可以检查形状是否是视频文件,然后更改上述设置,但 MSDN 参考对 Office 不是很有帮助-话题。如果重要的话,我正在使用 Powerpoint 2007 和 Visual Studio 2010。
I am currently trying to change some settings in a .pptx files via C# and Microsoft.Office.Interop.PowerPoint
. I have some .wmv movies linked on several slides of the presentation. At the time the presentations were created, all movies play as soon as they are clicked. However, I want to change this to start automatically playing as soon as the slide is viewed. This this has to be done to a lot of presentations, so there is no way to do this manually.
I found the PlaySettings.PlayOnEntry
property, but I can't figure out how to use it. I found several examples how to do this with a new movie to be embedded (and then, only for Visual Basic), but since the movies are already embedded, this is not what I want.
I also have no idea how I can actually access any objects on the current slide, maybe there is a way to check if a shape is a video-file and then change above setting, but the MSDN-Reference is not very helpful on Office-Topics. I'm using Powerpoint 2007 and Visual Studio 2010 if that matters.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@Lennart 的解决方案是其中的一部分,然后您需要一个页面触发器
@Lennart's solution is part of it, you then need a page trigger
知道了。搜索所有形状的演示文稿并过滤出电影作品:
Got it. Searching through all shapes of the Presentation and filtering out the movies works: