Run ppt with C#- urgent !!!!

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2006
Posts: 116
Reputation: bhavna_816 is an unknown quantity at this point 
Solved Threads: 0
bhavna_816 bhavna_816 is offline Offline
Junior Poster

Run ppt with C#- urgent !!!!

 
0
  #1
Dec 11th, 2008
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
  1. 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
  1. Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
  2. ppApp.Visible = MsoTriState.msoTrue;
  3. Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
  4. Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(e.FullPath,
  5. MsoTriState.msoFalse, MsoTriState.msoFalse,
  6. 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,
Last edited by bhavna_816; Dec 11th, 2008 at 2:09 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Run ppt with C#- urgent !!!!

 
0
  #2
Dec 11th, 2008
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.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 116
Reputation: bhavna_816 is an unknown quantity at this point 
Solved Threads: 0
bhavna_816 bhavna_816 is offline Offline
Junior Poster

Re: Run ppt with C#- urgent !!!!

 
0
  #3
Dec 11th, 2008
Originally Posted by LizR View Post
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....
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Run ppt with C#- urgent !!!!

 
0
  #4
Dec 11th, 2008
Same way you launch any of the applications. You would however need to know where to find slideshow.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 116
Reputation: bhavna_816 is an unknown quantity at this point 
Solved Threads: 0
bhavna_816 bhavna_816 is offline Offline
Junior Poster

Re: Run ppt with C#- urgent !!!!

 
0
  #5
Dec 11th, 2008
Thanks friends for your valuable replies. The main problem is solved of launching the slideshow of .ppt files.. with the help of this code

  1. Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
  2. ppApp.Visible = MsoTriState.msoTrue;
  3. Presentations ppPresens = ppApp.Presentations;
  4. Presentation objPres = ppPresens.Open(e.FullPath, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
  5. Slides objSlides = objPres.Slides;
  6. Microsoft.Office.Interop.PowerPoint.SlideShowWindows objSSWs;
  7. Microsoft.Office.Interop.PowerPoint.SlideShowSettings objSSS;
  8.  
  9. //Run the Slide show
  10. objSSS = objPres.SlideShowSettings;
  11.  
  12. objSSS.Run();
  13. objSSWs = ppApp.SlideShowWindows;
  14. while (objSSWs.Count >= 1) System.Threading.Thread.Sleep(100);
  15.  
  16. //Close the presentation without saving changes and quit PowerPoint
  17. objPres.Close();
  18. 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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Run ppt with C#- urgent !!!!

 
0
  #6
Dec 11th, 2008
Only guarenteed way would be to step through all the running processes and check that powerpoint isnt already running
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC