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???
Press ALT+F11 to start PowerPoint's VBA editor.
Start PowerPoint from command line and use the /M switch to have PowerPoint run a specified macro when it starts a named presentation file. The easiest way to do this is to create a shortcut to the PowerPoint application. Then go to the Properties window for the shortcut and select the Shortcut tab.
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 the SlideShowNextSlide
event?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With