gprabaka Posted October 13, 2005 Posted October 13, 2005 I am writing a webservice in C#.Net. I added the reference to Microsoft.Office.Interop.Word. When I attempt to do Documents.Open, I get the following error: Can someone pleease help. Thanks Guha Error System.Runtime.InteropServices.COMException (0x800A1066): Command failed The Code: strWordTemplateFile = Server.MapPath(AppSettings.SupportingDocumentsLocation + "/LicenseOrderConfirmation.doc"); strWordDocumentFile = "c:\\temp\\LicenseOrderConfirmation.doc"; objWordDocumentFile = "c:\\temp\\LicenseOrderConfirmation.doc"; Microsoft.Office.Interop.Word.ApplicationClass objWord = new Microsoft.Office.Interop.Word.ApplicationClass(); System.IO.File.Copy(strWordTemplateFile,strWordDocumentFile,true); object objVisible = false; objWord.Visible = false; objWord.Documents.Open(ref objWordDocumentFile,ref missing, ref missing, ref missing,ref missing, ref missing,ref missing, ref missing, ref missing, ref missing, ref missing, ref objVisible,ref missing,ref missing, ref missing, ref missing); Quote
herilane Posted October 14, 2005 Posted October 14, 2005 Office applications are simply not made to be run on a server... This could be a permissions issue, or it could be an unfixable problem with automating Word on a server. I've seen this problem mentioned before, but never seen a solution being proposed. Articles that you should read: INFO: Considerations for Server-Side Automation of Office How To Configure Office Applications for Automation from a COM+/MTS Package How to configure Office applications to run under a specific user account How to configure Office applications to run under the interactive user account Quote
gprabaka Posted October 14, 2005 Author Posted October 14, 2005 Thanks. I will look for alternatives. Quote
Recommended Posts