我可以在浏览器中打开Word文档或使用Html 5调用Word应用程序吗? [英] Can I Open Word Document In Browser Or Calling Ms Word Application Using Html 5 ..?

查看:400
本文介绍了我可以在浏览器中打开Word文档或使用Html 5调用Word应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在浏览器中打开Word文档或使用Html 5调用Ms Word应用程序吗?

Can I Open Word Document In Browser Or Calling Ms Word Application Using Html 5 ..?

推荐答案

你不能。 Word文档不是W3标准的一部分。你可能看到很多网站都这样做了。他们只是解释服务器端的文件并用HTML表示它的内容。你也可以做到的。您需要在与您的目的相关的HTML和Word文档之间开发一些映射。您可以使用Open XML SDK:

http:// www .microsoft.com / zh-CN / download / details.aspx?id = 30425 [ ^ ]。



顺便说一句,微软警告在服务器设置中使用Office Interop :

http://support.microsoft.com /default.aspx?scid=kb;EN-US;q257757#kb2 [ ^ ],

http://support.microsoft.com/kb/257757/en-us [ ^ ]。



这样,您可以支持新的基于XML的Office格式(例如.DOCX ,.XLSX),ECMA-376标准rd:

http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats [ ^ ],

http://en.wikipedia.org/wiki/Office_Open_XML [ ^ ]。



这样,您可以在没有安装Office的情况下工作。此外,第三方软件支持这些文档。请查看我过去的答案:

将Office文档转换为PDF而不互操作 [ ^ ],
需要一个相当独特的WPF文本编辑器控件 [ ^ ],

您好如何使用c#.net 在Windows应用程序中显示word文件[ ^ ],

阅读没有使用Interop.word dll的word文件...不想在IIS中安装单词。 [ ^ ]。



这是另一种选择: http://npoi.codeplex.com/ [ ^ ]。



-SA
You cannot. Word documents are not part of W3 standard. You probably saw many sites doing that. They just interpret the files on server side and represent it content with HTML. You can do the same. You need to develop some mapping between HTML and Word documents relevant to your purpose. You can use Open XML SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=30425[^].

By the way, Microsoft warns about using Office Interop in server settings:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^],
http://support.microsoft.com/kb/257757/en-us[^].

This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^].

This way, you can work without Office installed. Also, the documents are supported by 3rd-party software. Please see my past answers:
Convert Office-Documents to PDF without interop[^],
Need a rather unique WPF text editor control[^],
Hi how can i display word file in windows application using c#.net[^],
Read a word file without using Interop.word dll...Do not want to install word in IIS..[^].

This is another option: http://npoi.codeplex.com/[^].

—SA


只需嵌入Google Doc Viewer iframe并指定要显示的DOC文件。这是你应该添加的代码:



Just embed Google Doc Viewer through an iframe and specify the DOC file you want to display. This is the code you should add:

<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>





那么你只需要将自己的文档文件设置为url查询字符串参数就是这样!您不仅可以在任何浏览器中显示DOC,还可以显示查看器支持的任何其他文件,如pdf,xls等!



Then you just need to set up your own document file to the "url" query string param and that's it! You can display not just DOC but any other file supported by the viewer like pdf, xls, etc. in any browser!


这篇关于我可以在浏览器中打开Word文档或使用Html 5调用Word应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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