将 PowerPoint 查看器包含到我的 WPF 应用程序中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11432875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 08:35:39  来源:igfitidea点击:

Include PowerPoint viewer into my WPF application

c#.netwpfpowerpoint

提问by mlemay

I want to display my PowerPoint presentation into a WPF application.

我想将我的 PowerPoint 演示文稿显示到 WPF 应用程序中。

Requirements:

要求:

  • Free (except PowerPoint is already installed on the PC)
  • Has to be integrated into my WPF application, not an external one
  • User must have the possibility to advance to the next slide, or go back
  • Show animations
  • 免费(除了 PowerPoint 已经安装在 PC 上)
  • 必须集成到我的 WPF 应用程序中,而不是外部应用程序
  • 用户必须有可能前进到下一张幻灯片,或返回
  • 显示动画

I tried 2 solutions:

我尝试了两种解决方案:

  • Using DSOFramer, but they recommend to not use it anymore, and it doesn't support 2010 files. It's a no go.
  • Using Microsoft.Office.Interop.PowerPoint, but it opens the PowerPoint as an external application...
  • Tried the tool http://www.edrawsoft.combut it cost like 3500$ the licence
  • 使用 DSOFramer,但他们建议不要再使用它,并且它不支持 2010 文件。这是不行的。
  • 使用 Microsoft.Office.Interop.PowerPoint,但它将 PowerPoint 作为外部应用程序打开...
  • 尝试了该工具http://www.edrawsoft.com但它的许可证费用为 3500 美元

I don't know where to go with this.... Thank you.

我不知道该去哪里……谢谢。

Edit:

编辑:

Few months later, the only "good" solution that I can get all what I want (with animations, sound etc..) is to embed a c++ control... if wanyone have a solution for WPF and it's managed, I would like to know.

几个月后,我可以获得我想要的所有内容(包括动画、声音等)的唯一“好”解决方案是嵌入 C++ 控件......知道。

As for the given answer:

至于给出的答案:

Thanks

谢谢

回答by Jens H

Not the cleanest of solutions, but one we had to go for a few years ago in a .NET 1.1 application.

不是最干净的解决方案,而是我们几年前在 .NET 1.1 应用程序中不得不采用的解决方案。

1.)Provided that there is any application installed on the client system that a) can open Powerpoint files and b) has also installed a browser plugin to view them inside a browser window, you could use the WebBrowsercontrol and Navigate()to the Powerpoint file.

1.)如果客户端系统上安装了任何应用程序,a) 可以打开 Powerpoint 文件,并且 b) 还安装了浏览器插件以在浏览器窗口中查看它们,则您可以使用WebBrowser控件和Navigate()Powerpoint 文件。

If there is, for example, a MS office or OpenOffice installation on the client system, this would allow you to view Powerpoint presentations inside, say, Internet Explorer.

例如,如果客户端系统上安装了 MS Office 或 OpenOffice,则您可以在 Internet Explorer 中查看 Powerpoint 演示文稿。

2.)An alternative approach was to use the Microsoft Powerpoint Viewerand embed in a WinForms control. Unfortunately we had to use a very old version, I think for Office 2000, because newer version did not support embedding anymore as Microsoft told us. This might have changed in the meantime, but I do not know about that.

2.)另一种方法是使用Microsoft Powerpoint Viewer并嵌入到 WinForms 控件中。不幸的是,我们不得不使用一个非常旧的版本,我认为是用于 Office 2000,因为新版本不再支持嵌入,正如 Microsoft 告诉我们的那样。这可能在此期间发生了变化,但我不知道。

回答by Sebi

I just know that with DevExpress 12 it is possible to integrate PowerPoint, Excel, Word and Outlook as a Control. So you can put a PowerPoint Control on your form like a Textbox. DevExpress is a really nice framework but the disadvantage is, that one license costs 900 dollars.

我只知道使用 DevExpress 12 可以将 PowerPoint、Excel、Word 和 Outlook 作为控件集成。因此,您可以像文本框一样在表单上放置 PowerPoint 控件。DevExpress 是一个非常好的框架,但缺点是,一个许可证需要 900 美元。