是否可以将PowerPoint Viewer嵌入到C#Windows窗体中?在C#Win表单中嵌入PowerPoint Viewer
我目前使用下面的代码:
objApp = new PowerPoint.Application();
//objApp.Visible = MsoTriState.msoTrue;
objPresSet = objApp.Presentations;
objPres = objPresSet.Open(ppsAction.FileInfo.FullName, MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);
objSlides = objPres.Slides;
//Run the Slide show
objSSS = objPres.SlideShowSettings;
objSSS.ShowType = Microsoft.Office.Interop.PowerPoint.PpSlideShowType.ppShowTypeSpeaker;
objSSS.LoopUntilStopped = MsoTriState.msoTrue;
objSSS.Run();
WindowWrapper handleWrapper = new WindowWrapper(objPres.SlideShowWindow.HWND);
SetParent(handleWrapper.Handle, this.ApplicationPanel.Handle);
this.ApplicationPanel.Visible = true;
objPres.SlideShowWindow.Height = ApplicationPanel.Height;
objPres.SlideShowWindow.Width = ApplicationPanel.Width;
objPres.SlideShowWindow.Top = 0;
objPres.SlideShowWindow.Left = 0;
它显示的形式,但在布局上的观众和大小是错误的。人们如何确定尺寸并正确放置。
另一种选择:我也遇到意味着要用于显示的ActiveX的Aximp.exe应用
在C#中的赢窗体控件。我如何将这与PPT查看器一起使用?
看这个答案。 http://stackoverflow.com/a/10271255/1257567正是你想要的。 – diogopalhais 2012-04-22 19:26:10