Hi..,
I need to read a Doc or docx file and Bind the content of file in Label Box
This is the Code i used and got output.
object Unknown = Type.Missing;
string strTemp = "";
string strFile = string.Empty;
strFile = this.trFileView.SelectedNode.Text.ToString();
object FileName = Server.MapPath(strFile);
ApplicationClass wordApp = new ApplicationClass();
object file = FileName;
object nullobj = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(
ref file, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
string sFileText = doc.Content.Text;
doc.Close(ref nullobj, ref nullobj, ref nullobj);
wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);
lblText.Text = sFileText;
when i host this application into IIS Server I get error.
Server Error in '/KMS' Application.
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.
Can any one Solve this problem and also say What are the requirement needed to Host into IIS Server.
Regards,
Somasundaram