I'm developing a Winforms application that needs open a powerpoint presentation when a certain event occurs in the application, and start displaying the slides. When the presentation is finished I need to close the presentation.
Does anyone know how I should approach this?
There is a simple way to start a new process from C#
But, this wll open the Application and then you have to manually Full Screen it,
beside as i told you before there is a WebBrowser Control in VS2003/2005 in which you can navigate to the deired powerpoint file.
The code in the article works, but I think I need more control over the process, to know when the presentation is finished etc.. I think I'll experiment with the WebBrowserControl a bit..
If that doesn't work then I'll have to look more closely at the Interop stuff..
I've been experimenting with the WebBrowserControl.. So far it loads the powerpoint file without any problems, but there are a few issues I need to solve:
1.) It displays a "Do you want to open this file" dialog.
2.) I'm unable to get it to display fullscreen..
3.) I found this post:
In my code I hoped this would work:
PowerPoint.Presentation pres = webBrowser1.Document as PowerPoint.Presentation; pres.SlideShowSettings.LoopUntilStopped = true;
But I get this error, which seems reasonable, but why did it work for the person in the post linked above?
Cannot convert type 'System.Windows.Forms.HtmlDocument' to 'Microsoft.Office.Interop.PowerPoint.Presentation' via a built-in conversion
Anyone have a clue why this doesn't work for me, or how I can solve it?
i was looking for the same thing, vidar, but couldt not find a way to start the slideshow automaticly.
i made another program to solve the prolem. a program that converts .ppt to .pps, but that is not an optimal solution.
if you managed to make this, please share the code.