Hello
I am trying to build an application using ASP.NET MVC in which I have to view a word doc in a view. I searched a lot on the web and found that Microsoft.Office.Interop.Office can be used for this. The following are ( I guess ) the most important lines in the present code...
Application objWord = new Application();
objWord.Documents.Open(ref sourceFilePath, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
objWord.Visible = false;
Microsoft.Office.Interop.Word.Document oDoc = objWord.ActiveDocument;
oDoc.SaveAs(ref savefilename, ref fltDocFormat, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
I am trying to convert the doc file to htm format first, after which I will use iframe to view the document in the view.
But when I debug, the following exception is thrown at the "
Application objWord = new Application()
" line...
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)).
Can some one please help me.
Thanks.