COMException while opening MS-Word files using APIs
-
Hi, I am facing problem of COMException while opening MS-Word files on
Windows Server 2003. I am refering Interop.Word.dll for opening MS-Word files to count the
number of words from it. I am using following API to open the doc files.Word.ApplicationClass wordApp = null;
Word.Document aDoc = null;
aDoc = wordApp.Documents.Open(ref fileName, ref missing, ref readOnly, 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);
aDoc.Activate();If I deploy above code on
Windows 2000 professional then it works without error but if I deploy same code on Windows Server 2003 then I get following exception.System.Runtime.InteropServices.COMException (0x800A1066): Command failed at
Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles,
Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument,
Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible,
Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)Is there is other way to overcome this bug? -- modified at 2:41 Saturday 19th May, 2007
#Abhi#
-
Hi, I am facing problem of COMException while opening MS-Word files on
Windows Server 2003. I am refering Interop.Word.dll for opening MS-Word files to count the
number of words from it. I am using following API to open the doc files.Word.ApplicationClass wordApp = null;
Word.Document aDoc = null;
aDoc = wordApp.Documents.Open(ref fileName, ref missing, ref readOnly, 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);
aDoc.Activate();If I deploy above code on
Windows 2000 professional then it works without error but if I deploy same code on Windows Server 2003 then I get following exception.System.Runtime.InteropServices.COMException (0x800A1066): Command failed at
Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles,
Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument,
Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible,
Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)Is there is other way to overcome this bug? -- modified at 2:41 Saturday 19th May, 2007
#Abhi#
Hi! Do you have the same version of Word installed on both machines? (or rather 3 machines: The development machine that created
Interop.Word.dll
plays a role, too)Regards, mav -- Black holes are the places where God divided by 0...
-
Hi! Do you have the same version of Word installed on both machines? (or rather 3 machines: The development machine that created
Interop.Word.dll
plays a role, too)Regards, mav -- Black holes are the places where God divided by 0...
Hi, Thanks for reply. I have same version of Word installed that is Word 2003. Just OS are different.
Abhishek J
-
Hi, I am facing problem of COMException while opening MS-Word files on
Windows Server 2003. I am refering Interop.Word.dll for opening MS-Word files to count the
number of words from it. I am using following API to open the doc files.Word.ApplicationClass wordApp = null;
Word.Document aDoc = null;
aDoc = wordApp.Documents.Open(ref fileName, ref missing, ref readOnly, 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);
aDoc.Activate();If I deploy above code on
Windows 2000 professional then it works without error but if I deploy same code on Windows Server 2003 then I get following exception.System.Runtime.InteropServices.COMException (0x800A1066): Command failed at
Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles,
Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument,
Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible,
Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)Is there is other way to overcome this bug? -- modified at 2:41 Saturday 19th May, 2007
#Abhi#
Hi First create the Instance of the application using "new".
Manoj Never Give up