2

i am getting the following error while trying to open a Microsoft word document from within a c# VS.NET 2010 windows forms application.

"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))."

I am using a Windows 7 64 bit OS.

I have added the Microsoft.Office.Interop.Word in the project > references

i have set the Build platform to target x86 enviroment

using Word = Microsoft.Office.Interop.Word;
var wordApp = new Word.Application() {Visible = true}; <-- ERROR

What am I doing wrong?

Fraiser
  • 310
  • 2
  • 8
  • 18

2 Answers2

2

It seems that Word starter edition doesn't support automation.

porges
  • 30,133
  • 4
  • 83
  • 114
0

It seems that either

  • Word is not (correctly) installed on the machine, or
  • the platform target of your application is not set to x86 (you can do so under Project -> Properties).

Both are required for Word automation to work on an x64 system.

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316