Using and Add-in to perform Auto_Open

S

SixSigmaGuy

How can I get an Add-in to execute code in the Auto_Open macro only for
specific PPT files that I load? I've read through the examples and
downloaded the code samples, but everything I see only calls subroutines and
functions that are also in the add-in file. I.e., it executes every time
PowerPoint starts.

I'm written some code that will automatically update the footer of my slides
with the filename; so that it will always show the correct filename even when
someone does a SaveAs to a new name. But I don't want this same thing to
happen to any other PowerPoint slides I load/save.

Ideally, I'd like to do what Shyam Pillai did in his "autoevents" addin, but
he didn't provide the source code that I could find. I like the idea of
putting a "Auto_ShowBegin" routine in my slide presentation so that the
add-in calls it if the routine exists. But, when I try to do that in my
add-in, it won't compile because it can't resolve the name of the routine I
want to call in my PPT file. How does Shyam make an add-in that calls a
routine named "Auto_ShowBegin" when that routine exists in a different file
than the add-in?

Thanks for your help!
 
S

SixSigmaGuy

I read through the FAQ again, but, unless I'm misunderstanding something, it
still doesn't tell me how to do what I'm trying to do. There are several
references online on this topic, but they all depend on all the code
executing within the addin. I want to call code that's in in my PPT file
like Shyam Pillai does in his AutoEvents demo. Using his AutoEvents addin,
he allows me to put an event, e.g., Auto_ShowBegin, in my PPT file; not in my
PPA file, and it gets called when events occur in my PPT file. How does
Shyam compile a PPA file that makes calls to a PPT file when the PPT file
doesn't exist at the time he compiles the PPA? If I was writing this
functionality in C, I would just create a stub file so the linker could
resolve the addresses, but I can't do that in PowerPoint.

Any help would be greatly appreciated.
 
S

SixSigmaGuy

Yes! Thank you!

The Run method is exactly what I'm looking for. That's pretty cool; it's
like late binding. I can think of a lot of things I can do with that method.
:)

Rather than using "ActivePresentation" I'll probably trap the Pres object
from one of the standard events and use that.

Thanks!
 
H

Holly Crofts

I still don't get this. Where in the Add-In do I put the code:

Application.Run ActivePresentation.Name & "!Auto_ShowBegin"

If I put it in the Auto_Open sub in the Add-In it doesn't run correctly as
there is not yet an active presentation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top