Steve- thanks for your response. Unfortunately - this isn't doing the trick.
The problem is the order that events seem to be executed. My Auto_Open
routine runs before PP gets to opening a file. So everytime I run it,
Presentations.Count is always equal to 0 whether I open the app directly or
double-click on a file to open it. So with the code you provided, my code
will always run, even if the user opened the app by double-clicking a file.
Yes, I see the problem.
In your response, you mentioned that it might start with Presentation1 or it
might not. Is there a way to always start with a Presentation1 when the app
was opened directly. This way I could watch for the open event with
Pres.Name = Presentation1 then close that one and run my code.
As far as I can tell, Powerpoint 2003 and, I think, 2002 will always start a
new presentation on startup. Anybody want to tell me I'm wrong? Please jump
in. PowerPoint 2000 and prior have a user setting that pops up a dialog that
asks what you want to do, start a new presentation, open an old one, etc? If
you cancel out of that, you're left with no presentation open at all, so they'd
be less predictable.
Wild thoughts. What if you were to use the Sleep API - put your AutoOpen to
sleep for a second or two (presumably giving PPT time enough to brush its
teeth, shave and pull up its socks ... ) and THEN you check for Presentation1
Already thought of and tried Command$ - for some odd reason it's implemented in
PPT VBA but never seems to return anything, even though PPT was started with
the name of a file on the command line.
Thanks for your thoughts.
Peter
--
Steve Rindsberg, PPT MVP
PPT FAQ:
www.pptfaq.com
PPTools:
www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA
www.PowerPointLive.com
================================================