使用C#Win Form嵌入PowerPoint Viewer

是否可以将PowerPoint Viewer嵌入到C#Windows窗体中?

我目前使用以下代码:

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; 

它在表单上显示了查看器,但放置和大小调整是错误的。 如何正确放置和放置它。

另一种选择
我遇到过Aximp.exe应用程序,用于在C#中的Win Forms上显示ActiveX控件。 我如何在PPT Viewer中使用它?

看到这个链接。 您还可以在WebBrowser控件中显示ppt。 这可能也很有用。

感谢您的好链接, http://support.microsoft.com/kb/304662有用的信息……这对我有帮助:)

对于放置,将objPres.SlideShowWindow.Top更改为10并将objPres.SlideShowWindow.Left为12,以便幻灯片的左上角位于(12,10),其中左移水平,顶部垂直向下移动。