MS Word and ASP.NET with C#

  • Thread starter Thread starter Vasil Buraliev
  • Start date Start date
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);
 
Word automation is a powerful tool to generate documents but it is
also inherently vulnerable to many configuration issues. Many
conditions will provoke multiple instances getting "stuck" in memory,
and you will find the same code behaving differently on different
computers.

You might want to investigate XpertDoc as an alternative solution. It
creates genuine MS-Word documents without making any call to the
MS-Word application, making it more reliable, much faster and easier
to deploy and support.

You can check it out at www.xpertdoc.com.
 
Francis Dion said:
Word automation is a powerful tool to generate documents but it is
also inherently vulnerable to many configuration issues. Many
conditions will provoke multiple instances getting "stuck" in memory,
and you will find the same code behaving differently on different
computers.

You might want to investigate XpertDoc as an alternative solution. It
creates genuine MS-Word documents without making any call to the
MS-Word application, making it more reliable, much faster and easier
to deploy and support.

You can check it out at www.xpertdoc.com.


"Vasil Buraliev" <[email protected]> wrote in message
 
Back
Top