在WebBrowser控件C#中显示office文档 [英] Show office document in WebBrowser control C#

查看:106
本文介绍了在WebBrowser控件C#中显示office文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用C#构建Windows窗体应用程序,我想在WebBrowser控件中打开存储在硬盘中的Microsoft Office文件。这些是我找到的方法:





  • 来自Microsoft的教程,但它已经过时了,它适用于2005年的办公室




  • 使用ActiveX实例但它似乎也过时了,结果不是很好



  • 将文件转换为html文件,但结果不好,文档的某些部分缺失

  • 将文件转换为pdf文件,但它太长了


我一直在寻找一种更新,更有效的方法,有人可以帮我吗?

解决方案

< blockquote>

抱歉,我认为SHDocVw.dll和AxSHDocVw.dll已经过时,我没有找到如何使用AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event.pDisp(),所以我认为这是一种旧方法。


你是如何处理这些dll和那个事件的?


I'm building a Windows Form app in C# and I have want to open a microsoft office file stored in my hard drive in a WebBrowser control. These are the methods I found :

  • A tutorial from Microsoft but it's outdated, it was for office 2005

  • Use an ActiveX instance but it also seems outdated and the result isn't that fine

  • Convert the file into an html file but the result is bad, some parts of the document are missing
  • Convert the file into a pdf file but it's too long

I was looking for a more recent and more efficient way to do that, can anybody help me please?

解决方案

Sorry I thought SHDocVw.dll and AxSHDocVw.dll were outdated and I didn't find how to use the AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event.pDisp() so I concluded it was an old way to do that.

How did you deal with those dll and that event?


这篇关于在WebBrowser控件C#中显示office文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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