MS Word and ASP.NET with C#

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);
 
F

Francis Dion

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.
 
O

okamoto

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top