从ASP.Net读取/写入Word文档 [英] Read/Write Word Document from ASP.Net

查看:321
本文介绍了从ASP.Net读取/写入Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经编写了一个Web应用程序,以使用Microsoft Interop程序集读取ms-word文档.由于开发服务器已安装ms-office,因此工作正常.该应用程序未在未安装ms-office的生产服务器上运行,并收到错误消息:
System.UnauthorizedAccessException:由于以下错误,检索具有CLSID {000209FF-0000-0000-C000-000000000046}的组件的COM类工厂失败:80070005

我们只有有限的权限访问我们的生产服务器

任何帮助将不胜感激

谢谢

问候
Raj

We have written a web application to read ms-word document using microsoft interop assembly. It is working fine as the developement server has got ms-office installed. The application is not running on the production server where ms-office is not installed and getting error message:
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005

We have only limited access to our production server

Any help would be appreciated

Thank you

Regards
Raj

推荐答案

如果使用的是Microst Interop Assembly,则需要在生产服务器中安装MS-Office.因为Interop程序集是COM对象(在本例中为MS-Word)的包装,它将提供对MS-Word应用程序的访问.

您也可以使用OpenXML SDK读取/写入Word 2007格式(.docx)文档,该文档不需要在框中安装MS-Office.
If you are using Microst Interop Assembly then you need to install MS-Office in your production server. Because Interop assembly is a wrapper of COM object (in this case MS-Word) which will provide the access to the MS-Word application.

Also you can read/write Word 2007 Format (.docx) document using OpenXML SDK, which does not require MS-Office installed in the box.


这篇关于从ASP.Net读取/写入Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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