I am creating a folder watcher application.
If a new powerpoint file gets added in the folder it should get started automatically.
So if I put .pps file into the folder then and I say

System.Diagnostics.Process.Start(fullPath);

it works fine.
This is not the case with .ppt files
Only the powerpoint application gets started not the slideshow.I want the slideshow to be started.

I have done some R & D and found that Microsoft.Office.Interop.PowerPoint will help and done something like this

Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
								ppApp.Visible = MsoTriState.msoTrue;
								Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
								Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(e.FullPath,
									MsoTriState.msoFalse, MsoTriState.msoFalse,
									MsoTriState.msoTrue);

But this is also doing the application open not the slideshow, does anybody have any idea?
Also I want rest all powerpoint presentations gets closed and only currently added powerpoint application gets started as slideshow.
Thanks in advance,

Recommended Answers

All 5 Replies

Then you need to check the extension and specifically not just launch the ppt file as its put in the folder, but launch the slide show.

Then you need to check the extension and specifically not just launch the ppt file as its put in the folder, but launch the slide show.

That is the problem that How can i launch the slideshow programmatically with C# Windows applicaiton....

Same way you launch any of the applications. You would however need to know where to find slideshow.

Thanks friends for your valuable replies. The main problem is solved of launching the slideshow of .ppt files.. with the help of this code

Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
								ppApp.Visible = MsoTriState.msoTrue;
								Presentations ppPresens = ppApp.Presentations;
								Presentation objPres = ppPresens.Open(e.FullPath, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
								Slides objSlides = objPres.Slides;
								Microsoft.Office.Interop.PowerPoint.SlideShowWindows objSSWs;
								Microsoft.Office.Interop.PowerPoint.SlideShowSettings objSSS;

								//Run the Slide show
								objSSS = objPres.SlideShowSettings;

								objSSS.Run();
								objSSWs = ppApp.SlideShowWindows;
								while (objSSWs.Count >= 1) System.Threading.Thread.Sleep(100);

								//Close the presentation without saving changes and quit PowerPoint
								objPres.Close();
								ppApp.Quit();

Now I want to close all the running powerpoint files and only want to run the current one only...

Does any body have any idea?

Only guarenteed way would be to step through all the running processes and check that powerpoint isnt already running

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.