带有MS Office Word的C#应用​​程序 [英] C# Application With MS Office Word

查看:77
本文介绍了带有MS Office Word的C#应用​​程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个创建Word文档的C#应用​​程序.在我的开发箱上一切正常,事实证明这是安装了MS Office 2007的结果.该应用程序运行正常.当我执行添加引用"时,在"COM"选项卡下添加了对Microsoft Office 12.0对象库的引用.我也将Interop.Word.dll复制到了我的BIN文件夹中.我要将我的应用程序部署到的客户端计算机没有安装MS Office或Word.
当我运行应用程序时,出现以下错误

Hi,
I have a C# app which creates an Word Doc. This is all working fine on my development box which turns out to have MS Office 2007installed. The app works fine. I added a reference to Microsoft Office 12.0 Object Library under the COM tab when I did the "Add Reference". I also copiedthe Interop.Word.dll to my BIN folder.The Client Machine I need to deploy my app to does not have MS Office or Word installed.
When i Run Application the Following Error Came

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class Not Register


上述问题的任何解决方案都迫切...

我应该在客户端计算机上安装MS-Office吗?


Vijay


Any Solutions For Above Issue its Urgent...

Should I Install MS-Office to client machine.


Vijay

推荐答案

看看这个

http://forums.asp.net/t/1826017.aspx/1?Com+ Object + Error [^ ]

http://www.dreamincode.net/forums/topic/149362-com -error-on-word-application/ [
have a look around this

http://forums.asp.net/t/1826017.aspx/1?Com+Object+Error[^]

http://www.dreamincode.net/forums/topic/149362-com-error-on-word-application/[^]


在创建/编辑Microsoft Office文档时,始终喜欢使用Office Open XML SDK.这不需要在任何计算机上安装Office.所有Office文档(word,excel,powerpoint)(从2007年开始)都是xml软件包.因此,此SDK允许您使用程序创建或修改这些程序包.这种方法远比互操作方法更好.与互操作性相比,创建/修改文档所需的时间更少.另外,您可以一次处理多个请求(对于Interops,这当然是不可能的).

访问
开放xml开发人员论坛,以了解有关此内容的更多信息,
When you are creating/editing the Microsoft Office Documents, always prefer Office Open XML SDK. This does not require Office installation on any of the machines. All office documents (word, excel, powerpoint) (2007 onwards) are xml packages. So, this SDK allows you to create or modify these packages using programs. This approach is far better than interops approach. Time taken to create/modify the documents is less as compared with that of interops. Also, you can process multiple requests at a time (this is certainly not possible with Interops).

Visit open xml developer forum to know more about this,


这篇关于带有MS Office Word的C#应用​​程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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