Problem opening Word 2010 with Visual Studio 2010?

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

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

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

+4
source share
3 answers

You need to make sure that both Microsoft Office and Visual Studio Tools for Office (VSTO) are installed on the computer.

+2
source

VSTO is not a solution; In Visual Studio 2010, it is built-in.

I found a problem for me with the same error you are getting, is that I installed Office from the download using "Click to run". I downloaded Office on the first installation. This time I actually used the installation DVD, and now my code works fine. If you do not have a DVD, you can download the ISO trial file instead of the “Click to Run” exe.

+2
source

Word 2010 must be installed on the computer.

0
source

Source: https://habr.com/ru/post/1313984/


All Articles