2

I have an urgent request from client to enable loading of the word files(.doc).

the current functionality uses, OpenXml which allows only .docx files, and throws an exception if we try to upload/read .doc files.

so, i tried using Microsoft.Office.Interop.Word to read the data in file and for page count.

It all works in my local environment.(i am working using VS2008). but when i deployed in my development machine, i am getting an error “80040154 Class not registered”.

guys, i have already searched on this, but i am not sure what to do ... some says its because the development machine is 64bit.. if so, how to configure it to accept 32bit dll?

can any one just atleast guide me how to resolve this error, or is there any other ways reading word .doc file?

if you need any other information, please ask

Filburt
  • 17,626
  • 12
  • 64
  • 115
user1430035
  • 49
  • 1
  • 1
  • 3

1 Answers1

0

The COM object you are trying to access is not installed correctly on your deployment machine. The CLSID of the object needs to be in the registry.

You can check if you have the interop assemblies for MS Word installed.

You can check this questions also.

Community
  • 1
  • 1
Alexandru C.
  • 3,337
  • 1
  • 25
  • 27
  • Thanks for a quick reply, But can u please tell how to register and what needs to be done on deployment machine. and one more, The interop.word is a dll of GAC, not a COM object right? why does COM error pop out? – user1430035 Jun 01 '12 at 09:39
  • The exact error is below: Problem in reading CON2010-CN-001.doc: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154. – user1430035 Jun 01 '12 at 09:44
  • The interop assemblies are wrappers that use the COM dlls provided by MS Office. So at some layer you use COM, although it's transparent to you. Did you install the interop stuff for MS Office, from the link above? Are the COM dlls available on the machine (MS Office installed). – Alexandru C. Jun 01 '12 at 09:54
  • oh.. now i understand, thanks a lot.. i dont have access to deployment machine, i need to tell the person what to do? what COM dlls should be there? Microsoft.Office.Interop.Word.dll is present in Bin folder of my project. Is there anything I am missing? – user1430035 Jun 01 '12 at 11:35
  • Alexandru, do i need to add any other dll? – user1430035 Jun 01 '12 at 11:58
  • A list of dlls is [here](http://support.microsoft.com/kb/328912). I think a normal MS Office installation will add all the necessary COM dlls in place. Another link you should check is [this](http://msdn.microsoft.com/en-us/library/cc563937.aspx). Also make sure you have the same .NET version on the deployment machine as on the development machine ... that might cause issues also. – Alexandru C. Jun 01 '12 at 13:01
  • Hi Alexandru, i have confirmed that all the PIA are installed in my development machine, yet i am getting the error. – user1430035 Jun 14 '12 at 16:52