PDA

View Full Version : Solved: How To Auto Run PPT Macro



jamescol
07-23-2004, 03:42 PM
OK - I'm stumped. I have a custom form I want to start when a user opens a PPT template. I tried using the PresentationOpen and NewPresentation subs, but it looks like some other procedure needs to trigger them.

Anyone have any ideas?

Thanks,
James

Anne Troy
07-23-2004, 04:30 PM
From VB: http://www.rdpslides.com/pptfaq/FAQ00580.htm

The honest truth: http://www.rdpslides.com/pptfaq/FAQ00611.htm

In particular, this part:

Code That Runs Automatically
Some Office applications have a way to run VBA code automatically when the user opens a document; not PowerPoint.

But an Auto_Open subroutine within an Add-in will run at the time the Add-in loads, so IF you can create an Add-in and install it on the user's computer Create an ADD-IN with TOOLBARS that run macros (http://www.rdpslides.com/pptfaq/FAQ00031.htm) then
The Add-in can respond to events - Make PPT respond to events (http://www.rdpslides.com/pptfaq/FAQ00004.htm)

It can detect things like "The user just opened a presentation".
You could use this and some extra code to detect that "The user just opened OUR presentation" and run any other code you like in response.

jamescol
07-23-2004, 10:54 PM
Thanks Dreamboat! I was able to create the add-in and load a custom toolbar and Tools menu option. What a pain to launch code in PPT :(

Interesting, though, this solves another issue for me. Since the add-in stores all the VBA code, I can now separate the code from the presentation. Now we can send it customers after we're done without the VBA code.

James

Anne Troy
07-23-2004, 11:12 PM
Mark it solved? :)

(After all your help, it's about time you got some!)

jamescol
07-24-2004, 03:46 AM
Ha! Yep - this is solved!