问题使用Visual Studio 2010中打开Word 2010? [英] Problem in Opening Word 2010 using Visual Studio 2010?

查看:639
本文介绍了问题使用Visual Studio 2010中打开Word 2010?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用C#在VS2010的Word文档。不过,我已经成功至今。我试图寻找答案,但一切都是徒劳。在参考部分,我看不出在COM选项卡中的Microsoft Word办公库(任何版本)。我加入的Microsoft.Office.Interop.Word。 14版从.NET选项卡,但我仍然得到同样的异常:

I have been trying to open a Word document using C# in VS2010. But I have been successful so far. I have tried searching for answers but all in vain. In the reference section, I cannot see the Microsoft Word office library (any version) in the COM tab. I added the Microsoft.Office.Interop.Word. version 14 from the .Net tab, but still i get the same exception:


未处理的异常系统。 Runtime.InteropServices.COMException'
出现在mscorlib.dll

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

更多信息:用CLSID检索COM类工厂组件{000209FF-0000-0000-C000-000000000046}失败,原因是出现以下错误:80040154没有注册类(从HRESULT异常:0x80040154的(REGDB_E_CLASSNOTREG))。

Additional information: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

推荐答案

VSTO是解决不了问题; Visual Studio 2010中有它内置的。

VSTO is not the solution; Visual Studio 2010 has it built in.

我发现这个问题,我与你得到的是,我使用了点击安装Office从下载完全相同的错误跑步。我没有下载Office我第一次安装。这一次,我实际使用的安装DVD,现在我的代码完美。如果你不具备DVD,那么你可以下载试用的ISO文件,而不是点击运行执行。

I found the problem for me with the exact same error that you are getting was that I installed Office from the download using the "Click to run". I did download Office the first time I installed. This time I actually used the install DVD and now my code works perfectly. If you don't have the DVD then you can download the trial ISO file instead of the "Click to run" exe.

这篇关于问题使用Visual Studio 2010中打开Word 2010?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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