PowerPoint SlideShowBegin Event Firing Multiple Times Per Slide?

D

Darwin

I think I'm having a problem with the "SlideShowBegin" event.

I am writing a PowerPoint COM AddIn using C# and when I trap the
"SlideShowBegin" event it is firing fine when a single file is open and I go
into "Slide Show" (F5) mode. No problem -- I am able to perform a test and
perform several initializations.

So here' the problem I'm having: If there are multiple ".ppt" files open,
when I go into "Slide Show" mode, the "SlideShowBegin" event (and therefore
my C# event handler method) is being called multiple times. Not good! (I
think it's called once per open ".ppt" file, but I haven't carefully tested
this to make sure).

Is this expected or correct behavior? Or could I be initializing something
incorrectly? Also, is there a better way to initialize something at the
beginning of every Slide Show?

Perhaps I could add some sort of flag to my "SlideShowBegin" event handler
method so that body of this method is only executed once. Then I would reset
it when the "SlideShowEnd" event is fired. However, this really seems like a
unnecessary hack.

Thank you in advance for your assistance with this most frustrating and
nagging problem I've been having.
 
D

Darwin

Thanks for your prompt reply Steve.

In your reply below you state:
I'd expect the SlideShowBegin event to fire when each of the presentations
starts in slide show view. It's not clear from your description if that's
actually the case or now. If just one is in slide show view but the event is
triggering multiple times, then it'd seem that something's amiss.

Unfortunately, when multiple PowerPoint files are open it's firing multiple
times when a single slide show (i.e., one of the open ".ppt" files) if
played. Again, I'm not sure why this is happening? And, yes, I understand
that the "SlideShowBegin" event is supposed to fire [once] when each of the
[individual] presentations starts in slide show view.

I also failed to mention that I noticed that when PowerPoint has multiple
files open, only a single "PowerPnt.exe" process is running with multiple
windows.

Thanks again for your sharing your professional expertise with the Microsoft
Office PowerPoint application.

Best Regards,
 
A

Austin Myers

Darwin,

I have never seen this happen, can you post your code?


Austin Myers
AT&W Technologies

Creators of PowerPoint add-ins


Darwin said:
Thanks for your prompt reply Steve.

In your reply below you state:
I'd expect the SlideShowBegin event to fire when each of the
presentations
starts in slide show view. It's not clear from your description if
that's
actually the case or now. If just one is in slide show view but the
event is
triggering multiple times, then it'd seem that something's amiss.

Unfortunately, when multiple PowerPoint files are open it's firing
multiple
times when a single slide show (i.e., one of the open ".ppt" files) if
played. Again, I'm not sure why this is happening? And, yes, I
understand
that the "SlideShowBegin" event is supposed to fire [once] when each of
the
[individual] presentations starts in slide show view.

I also failed to mention that I noticed that when PowerPoint has multiple
files open, only a single "PowerPnt.exe" process is running with multiple
windows.

Thanks again for your sharing your professional expertise with the
Microsoft
Office PowerPoint application.

Best Regards,

--
Darwin

Camas Imaging Group


Steve Rindsberg said:
I'd expect the SlideShowBegin event to fire when each of the
presentations
starts in slide show view. It's not clear from your description if
that's
actually the case or now. If just one is in slide show view but the
event is
triggering multiple times, then it'd seem that something's amiss.






==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/
 
D

Darwin DeVore

Thanks Again Steve,

Well it appears that when I output the value of "Wn.HWND" to a MessageBox on
entry into the "SlideShowBegin" event handler the 7 digit decimal value is
the same. Again, this MessageBox containing the Window handle would be
displayed multiple times. If, however, I go into "Slide Mode" for a second
(and different) presentation a different decimal value is repeatedly
displayed.

At this point I think I'm going to create a very basic PowerPoint AddIn
using C# and add in this "SlideShowBegin" event handler and see what happens.
Then if necessary I can post some of this code here.

--
Darwin DeVore

Camas Imaging Group


Steve Rindsberg said:
Thanks for your prompt reply Steve.

In your reply below you state:
I'd expect the SlideShowBegin event to fire when each of the presentations
starts in slide show view. It's not clear from your description if that's
actually the case or now. If just one is in slide show view but the event is
triggering multiple times, then it'd seem that something's amiss.

Unfortunately, when multiple PowerPoint files are open it's firing multiple
times when a single slide show (i.e., one of the open ".ppt" files) if
played. Again, I'm not sure why this is happening? And, yes, I understand
that the "SlideShowBegin" event is supposed to fire [once] when each of the
[individual] presentations starts in slide show view.

So it really does seem that you've found a bug. Let's see, as I recall, the event
gives you a reference to the window that triggered it. What properties does the
window have that you might be able to test (and does it keep passing the same
window reference rather than a distinct/different reference for each open PPT?)
I also failed to mention that I noticed that when PowerPoint has multiple
files open, only a single "PowerPnt.exe" process is running with multiple
windows.

That's always the case. PPT only allows one instance of itself, unlike Word and
Excel.
Thanks again for your sharing your professional expertise with the Microsoft
Office PowerPoint application.

Best Regards,


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/
 
D

Darwin DeVore

Good Morning Steve,

I just finished modifying one of the PowerPoint AddIn sample/demo
applications to add in an "SlideShowBegin" event handler, and just as in my
production application my event handler is being called multiple times. So,
what's next? Any suggestions.

Following is a snippit of C# code that I added into "connect.cs" file to
test the "SlideShowBegin" event handler:

public void OnStartupComplete(ref System.Array custom)
{
...

// Add in the necessary PowerPoint application Event Handlers ...
//
applicationObject.SlideShowBegin += new
PowerPoint.EApplication_SlideShowBeginEventHandler(applicationObject_SlideShowBegin);

object oName = applicationObject.GetType().InvokeMember("Name",
BindingFlags.GetProperty, null, applicationObject, null);

// Display a simple message to show which application you
started in.
System.Windows.Forms.MessageBox.Show("This Addin is loaded by "
+ oName.ToString(), "MyCOMAddin");
oStandardBar = null;
oCommandBars = null;
} /** end OnStartupComplete **/

...
...

void applicationObject_SlideShowBegin(SlideShowWindow Wn)
{
System.Windows.Forms.MessageBox.Show("Connect.cs:
[applicationObject_SlideShowBegin] Entering event handler ... Window handle
= " + Wn.HWND, "MyCOMAddin");
}


I can also email you my complete sample AddIn code if you wish.

Thanks in advance for your continued assistance with this issue.

Best Regards,

Darwin

--
Darwin DeVore
Camas Imaging Group


Steve Rindsberg said:
Thanks for your prompt reply Steve.

In your reply below you state:
I'd expect the SlideShowBegin event to fire when each of the presentations
starts in slide show view. It's not clear from your description if that's
actually the case or now. If just one is in slide show view but the event is
triggering multiple times, then it'd seem that something's amiss.

Unfortunately, when multiple PowerPoint files are open it's firing multiple
times when a single slide show (i.e., one of the open ".ppt" files) if
played. Again, I'm not sure why this is happening? And, yes, I understand
that the "SlideShowBegin" event is supposed to fire [once] when each of the
[individual] presentations starts in slide show view.

So it really does seem that you've found a bug. Let's see, as I recall, the event
gives you a reference to the window that triggered it. What properties does the
window have that you might be able to test (and does it keep passing the same
window reference rather than a distinct/different reference for each open PPT?)
I also failed to mention that I noticed that when PowerPoint has multiple
files open, only a single "PowerPnt.exe" process is running with multiple
windows.

That's always the case. PPT only allows one instance of itself, unlike Word and
Excel.
Thanks again for your sharing your professional expertise with the Microsoft
Office PowerPoint application.

Best Regards,


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/
 

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