views:

40

answers:

1

I have a C# application that runs on a computer connected to a large display in our cafeteria. The application pulls all the PowerPoint files out of a folder and runs each one as a slide show continuously. Everything was working fine until someone decided to insert a movie clip onto a slide. The problem is that the movie never starts. If open the presentation in PowerPoint and run the show it works, and if I right click on the presentation and click 'show' it works. Here is the code I am using to open the presentation and start the slideshow.

pres = app.Presentations.Open(pptPath, MsoTriState.msoTrue, MsoTriState.msoTrue, MMsoTriState.msoFals);
pres.SlideShowSettings.Run();

Is there something else I need to set to get the Run() method to also start movies?

Edit: The presentation in question only had one slide in it which contained the movie. If I added another slide to it, it worked fine. Also tried adding a slide before and had the same problem, so apparently the problem only exists for the last slide in the presentation.

A: 

Found the problem. I had a thread.sleep statement in the presentation's app_SlideShowNextSlide event handler that handled the end of one slideshow and starting the next. I wasn't thinking at the time and this code was running in the same thread at the slideshow itself. I created a timer object instead and moved the necessary code into the timer's elapsed event handler.

AdmSteck
-1. You didn't mention you had code in `SlideShowNextSlide`.
Otaku