Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / April 2007

Tip: Looking for answers? Try searching our database.

Using and Add-in to perform Auto_Open

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SixSigmaGuy - 01 Feb 2007 18:14 GMT
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!
Bill Dilworth - 02 Feb 2007 00:40 GMT
The oldest working FAQ link addresses that very topic.

**Make PPT respond to events
http://www.pptfaq.com/FAQ00004.htm

Signature

Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@     Please read the PowerPoint FAQ pages.
yahoo.             They answer most of our questions.
com                 www.pptfaq.com
.

> 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
[quoted text clipped - 23 lines]
>
> Thanks for your help!
Steve Rindsberg - 02 Feb 2007 04:44 GMT
What Bill said.

And as a working strategy, look at responding to the PresentationOpen and
possibly NewPresentation events.  Have the event handling routine check for some
unique property of your presentation (say, the presence of a specially named or
tagged shape that represents your footer) and do nothing unless that shape's
found.

> 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
[quoted text clipped - 17 lines]
>
> Thanks for your help!

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
SixSigmaGuy - 07 Feb 2007 23:25 GMT
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.

> What Bill said.
>
[quoted text clipped - 31 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 08 Feb 2007 03:12 GMT
When you wrote: "How can I get an Add-in to execute code in the Auto_Open macro only
for specific PPT files that I load?"  I think I misinterpreted what you're after.  

This in your addin would fire off Sub Auto_ShowBegin in your presentation:

Application.Run "FileName.PPT!Auto_ShowBegin"

Or more likely, something like:

Application.Run ActivePresentation.Name & "!Auto_ShowBegin"

You'd want that to be thoroughly error trapped, of course.

> 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
[quoted text clipped - 45 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
SixSigmaGuy - 08 Feb 2007 18:21 GMT
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!


> When you wrote: "How can I get an Add-in to execute code in the Auto_Open macro only
> for specific PPT files that I load?"  I think I misinterpreted what you're after.  
[quoted text clipped - 64 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 09 Feb 2007 04:58 GMT
> Yes!  Thank you!
>
[quoted text clipped - 4 lines]
> Rather than using "ActivePresentation" I'll probably trap the Pres object
> from one of the standard events and use that.

That might be a better idea.  Or in the case of events that pass shapes, the shape's
Parent.Parent property would give you a ref to the presentation.

> Thanks!
>  
[quoted text clipped - 67 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
Holly Crofts - 05 Apr 2007 15:38 GMT
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.

> When you wrote: "How can I get an Add-in to execute code in the Auto_Open macro only
> for specific PPT files that I load?"  I think I misinterpreted what you're after.  
[quoted text clipped - 64 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 06 Apr 2007 02:35 GMT
> 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.

Right.  You'd want the Auto_Open sub to set up event handling.
You'd have the event handling routine respond to the SlideShowBegin event and run
whatever code you need then.

> > When you wrote: "How can I get an Add-in to execute code in the Auto_Open macro only
> > for specific PPT files that I load?"  I think I misinterpreted what you're after.  
[quoted text clipped - 64 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.