如何将新的 wpf 页面添加到 powerpoint 加载项中?
我创建了一个 PowerPoint 加载项,并且想向其中添加一个新的 WPF 窗口。似乎当我无法执行此操作时,因为不支持将 WPF 表单添加到加载项项目中。我能做些什么?非常感谢任何帮助。
I created an add-in for PowerPoint and I want to add a new WPF window to it. It seems that when I am not able to do this as there is no support to add a WPF form into add-in project. What can I do? Any help is very appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要创建一个普通的 WinForms 窗格,然后使用 ElementHost 向其中添加一个 WPF UserControl。
You need to create a normal WinForms pane, then add a WPF UserControl to it using ElementHost.
我执行了以下操作:
1- 在 Vs 2010 中创建 Office 项目
2- 添加对项目所需的引用以使用 WPF 相关程序集,如下所述: http://msdn.microsoft.com/en-us/library/ms742193(v=vs.85).aspx
3- 添加一个 wpf 窗口(均为 .xaml am 和 xaml.cs )如上述文档中所述
4- 在我的 Office 应用程序中,使用 mainWindow.show() 显示 WPF 窗口
I did the following:
1- Create the office project in Vs 2010
2- Add required references to the project to use WPF related assemblies as explained here: http://msdn.microsoft.com/en-us/library/ms742193(v=vs.85).aspx
3- Add a wpf window (both .xaml amnd xaml.cs ) as explained in the above document
4- In my office application, show the WPF window using mainWindow.show()