如何让 Powerpoint 在动画中调用我的 VBA 子例程?
我最终想要做的是每次新幻灯片出现在我的 PowerPoint 幻灯片放映中时,ShellExecute()
都是一个命令行程序。我正在使用 Office 2003 PowerPoint。
我执行了以下操作:
工具>选项>安全选项>宏安全>安全级别 = 中
工具 > 选项 > 宏 > VBA 编辑器:
Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow) MsgBox(“OnSlideShowPageChange”) 结束子
文件> 保存
返回 PowerPoint:F5(用于幻灯片放映 > 查看放映)。 没有看到消息框
退出 PowerPoint,重新打开 .ppt 文件,再次F5)。 仍然看不到消息框
问题:我错过了什么?为什么当我运行幻灯片放映时 OnSlideShowPageChange
没有被调用???
What I ultimately want to do is ShellExecute()
a command-line program every time a new slide appears in my PowerPoint slide show. I'm using Office 2003 PowerPoint.
I did the following:
Tools > Options > Security Options > Macro Security > Security Level = Medium
Tools > Options > Macro > VBA Editor:
Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow) MsgBox ("OnSlideShowPageChange") End Sub
File > Save
Back to PowerPoint: F5 (for Slide Show > View Show). Did NOT see the message box
Exit out of PowerPoint, reopen the .ppt file, F5) again. Still don't see the message box
Question: What am I missing? Why isn't OnSlideShowPageChange
getting invoked when I run the slide show???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它对我来说工作得很好,完全按照您上面的步骤操作。我唯一能想到的是在上面的步骤 #2 中,您可能已将自动宏
OnSlideShowPageChange
放入类或用户窗体中。它应该进入一个模块(任何模块,任何名称)。或者您是否还有其他可能会干扰的代码,例如您是否还接收了SlideShowNextSlide
事件?It's working just fine for me, using exactly your steps above. The only think I can think of is on step #2 above, you may have put the automacro
OnSlideShowPageChange
in a Class or UserForm. It should go into a Module (any module, any name). Or do you have other code in there that may be interfering, like are you also sinking theSlideShowNextSlide
event?