V
Vasil Buraliev
Hallo.
I'm trying to create word document from ASP.NET and I don't have problem.
The problem is when I try to close, destroy Word.ApplicationClass instance.
First row of example below start two processes. I can see in Task Manager
two inctances of WINWORD.EXE.
Would someone explain me that, or please send some URL related with this
question.
With last row of example I can close/kill one WINWORD.EXE process but
another one is still in memory. I don't know how to close this process from
code. Would you help me please about this?
best regards
Vasil Buraliev
example:
Word.ApplicationClass oWordApp = new Word.ApplicationClass();
object missing = System.Reflection.Missing.Value;
object readOnly = false;
object fileName = Server.MapPath("worddoc.doc");
object isVisible = true;
Word.Document oWordDoc = oWordApp.Documents.Add(ref missing, ref missing,
ref missing, ref isVisible);
oWordDoc.Activate();
oWordApp.Selection.TypeText("Íåìà ïðîáëåì íè ñî êèðèëèöà.");
oWordApp.Selection.TypeParagraph();
oWordDoc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref
missing, ref missing,
ref readOnly, ref missing, ref missing, ref missing, ref missing, ref
missing, ref missing,
ref missing, ref missing, ref missing);
oWordApp.Application.Quit(ref missing, ref missing, ref missing);
I'm trying to create word document from ASP.NET and I don't have problem.
The problem is when I try to close, destroy Word.ApplicationClass instance.
First row of example below start two processes. I can see in Task Manager
two inctances of WINWORD.EXE.
Would someone explain me that, or please send some URL related with this
question.
With last row of example I can close/kill one WINWORD.EXE process but
another one is still in memory. I don't know how to close this process from
code. Would you help me please about this?
best regards
Vasil Buraliev
example:
Word.ApplicationClass oWordApp = new Word.ApplicationClass();
object missing = System.Reflection.Missing.Value;
object readOnly = false;
object fileName = Server.MapPath("worddoc.doc");
object isVisible = true;
Word.Document oWordDoc = oWordApp.Documents.Add(ref missing, ref missing,
ref missing, ref isVisible);
oWordDoc.Activate();
oWordApp.Selection.TypeText("Íåìà ïðîáëåì íè ñî êèðèëèöà.");
oWordApp.Selection.TypeParagraph();
oWordDoc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref
missing, ref missing,
ref readOnly, ref missing, ref missing, ref missing, ref missing, ref
missing, ref missing,
ref missing, ref missing, ref missing);
oWordApp.Application.Quit(ref missing, ref missing, ref missing);