Open MS Word 2003 document from VS2005- ASP.NET web page- Help nee

Open MS Word 2003 document from VS2005- ASP.NET web page- Help nee

am 14.01.2008 19:13:05 von ravi

public WordApp()
{
//oWordAppl = new
Microsoft.Office.Interop.Word.ApplicationClass();
}

When I click a button in my aspx file I geet the followign error. I am
trying to open word from server side (Word is also isntalled in windows2003
server)
Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following error:
80080005.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving
the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following error:
80080005.

Source Error:


Line 31: public WordApp()
Line 32: {
Line 33: oWordAppl = new Word.ApplicationClass();
Line 34: //oWordAppl = new
Microsoft.Office.Interop.Word.ApplicationClass();
Line 35: }


Source File: d:\inetpub\wwwroot\PROBATION_NET\App_Code\WordApp.cs Line: 33

Stack Trace:


[COMException (0x80080005): Retrieving the COM class factory for component
with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following
error: 80080005.]
WordApp..ctor() in d:\inetpub\wwwroot\PROBATION_NET\App_Code\WordApp.cs:33
DrugTest_DrugTest.Button2_Click(Object sender, EventArgs e) in
d:\inetpub\wwwroot\PROBATION_NET\DrugTest\DrugTest.aspx.cs:2 79
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+107

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEven tHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




------------------------------------------------------------ --------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42

Re: Open MS Word 2003 document from VS2005- ASP.NET web page- Help nee

am 14.01.2008 19:56:35 von mark

"Ravi" wrote in message
news:0CA33C9F-E0E9-4558-A6A7-C538027FB95F@microsoft.com...

> public WordApp()
> {
> //oWordAppl = new
> Microsoft.Office.Interop.Word.ApplicationClass();
> }

Server-side instantiation of Office is extremely risky and unstable, and
neither recommended nor supported by Microsoft:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257 757#kb2
http://support.microsoft.com/default.aspx/kb/288367

Uninstall Word from your webserver and use this instead:
http://www.aspose.com/Products/Aspose.Words/


--
Mark Rae
ASP.NET MVP
http://www.markrae.net