6

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:

  1. Tools > Options > Security Options > Macro Security > Security Level = Medium

  2. Tools > Options > Macro > VBA Editor:

    Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
      MsgBox ("OnSlideShowPageChange")
    End Sub
    
  3. File > Save

  4. Back to PowerPoint: F5 (for Slide Show > View Show). Did NOT see the message box

  5. 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???

Todd Main
  • 28,951
  • 11
  • 82
  • 146
paulsm4
  • 114,292
  • 17
  • 138
  • 190

1 Answers1

1

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?

Todd Main
  • 28,951
  • 11
  • 82
  • 146
  • Hi, Otaku - thank you very much. It's working again. I did the following: 1. Backed everything down to an "old" version of the file (originally created with PPT 2003, but I was juggling back and forth between 2003 and 2007!) 2. Re-added (from the "old", "virgin") file the snippet above 3. Added it to a module (NOT a class module or a form, per your advice) ... and it worked! Thank you! – paulsm4 Aug 19 '10 at 02:52
  • @paulsm4, may i ask you to have a look at this question on another topic: http://stackoverflow.com/questions/11116963/bangla-language-not-displayed-in-the-unicoded-csv-file ? – Istiaque Ahmed Jun 20 '12 at 10:05