将Word Excel加载到WPF中 [英] Load Word Excel into WPF

查看:196
本文介绍了将Word Excel加载到WPF中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Word或Excel文档加载到WPF应用程序的窗口中,以便用户可以在应用程序中查看或编辑文档。有没有办法实现?

I would like to load a Word or Excel document into a window of a WPF application so that users can view or edit the document within the application. Is there any way to achieve that?

推荐答案

从工具箱中添加Web浏览器控件,然后在其中加载Word文档。
您甚至可以打开浏览器支持的任何文档,例如Word,Excel,PDF,SWF等...

You add web browser control from toolbox and then load the Word document in it. You can even open any document that browser support e.g. Word, Excel, PDF, SWF etc...

示例加载Word

webBrowser1.Navigate("C:\\word.doc");

示例加载Excel

webBrowser1.Navigate("C:\\excel.xls");

这篇关于将Word Excel加载到WPF中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆