Ik probeer de volgende HOW TO te bouwen:
HOW TO: Automate Word from Visual C# .NET to Create a New Document
Als ik deze in VS.NET 2003 maak als een Windows Application, dan werkt het prima en genereert hij prima een nieuw word-document.
MAAR, ik wil het graag in ASP.NET hebben. Dus heb ik dezelfde code geprobeerd te gebruiken in een ASP.NET Web Application.
Naar mijn mening moet dit niet veel uitmaken, maar hij geeft de volgende error waar ik niet veel mee kan:
System.Runtime.InteropServices.COMException: There is insufficient memory. Save the document now.s
Heeft iemand een idee wat ik zou moeten aanpassen om het in ASP.NET wel werkend te krijgen, of heeft iemand een andere suggestie om word-documenten te genereren met ASP.NET
HOW TO: Automate Word from Visual C# .NET to Create a New Document
Als ik deze in VS.NET 2003 maak als een Windows Application, dan werkt het prima en genereert hij prima een nieuw word-document.
MAAR, ik wil het graag in ASP.NET hebben. Dus heb ik dezelfde code geprobeerd te gebruiken in een ASP.NET Web Application.
Naar mijn mening moet dit niet veel uitmaken, maar hij geeft de volgende error waar ik niet veel mee kan:
System.Runtime.InteropServices.COMException: There is insufficient memory. Save the document now.s
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| Server Error in '/CreateWord' Application. -------------------------------------------------------------------------------- There is insufficient memory. Save the document now. 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: There is insufficient memory. Save the document now. Source Error: Line 60: oWord = new Word.Application(); Line 61: oWord.Visible = true; Line 62: oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); Line 63: Line 64: //Insert a paragraph at the beginning of the document. Source File: c:\inetpub\wwwroot\createword\webform1.aspx.cs Line: 62 Stack Trace: [COMException (0x800a13e9): There is insufficient memory. Save the document now.] Word.Documents.Add(Object& Template, Object& NewTemplate, Object& DocumentType, Object& Visible) +0 CreateWord.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\createword\webform1.aspx.cs:62 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain() -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 |
Heeft iemand een idee wat ik zou moeten aanpassen om het in ASP.NET wel werkend te krijgen, of heeft iemand een andere suggestie om word-documenten te genereren met ASP.NET
VDROOS