简体   繁体   中英

Remote MS PowerPoint slide by socket C#

I want to remote slide PowerPoint use socket C# like: next/previous slide and go to slide number. First, I can connect 2 computer and do something. But I don't know how to remote PowerPoint. I though I could send keystrokes to it, but the problem is I cannot determine exactly presentation windows (Specially window with UNICODE title). Is there any way to solve this problem? Or how can I remote slide without keystrokes?

Thanks!

I would suggest to use the namespace Microsoft.Office.Interop.PowerPoint from the Primery Interop Assembly for Office. The code should be something like this:

var  ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
ppApp.Visible = MsoTriState.msoTrue;
var ppPresens = ppApp.Presentations;
var  objPres = ppPresens.Open(e.FullPath, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
var  objSlides = objPres.Slides;                                                                            
//Run the Slide show
var objSSS = objPres.SlideShowSettings;    
objSSS.Run();
var objSSWs = ppApp.SlideShowWindows;
while (objSSWs.Count >= 1) 
   System.Threading.Thread.Sleep(1000);
objPres.Close();
ppApp.Quit();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM