Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hi all,

I use Microsoft.Office.Interop.Word; to create a Microsoft Word file.
But after I close my application. There are many WINWORD.exe run in task manager.

I tried to use Application.Quit, use Marshal.ReleaseComObject(), and
MIDL
GC.Collect(); GC.WaitForPendingFinalizers();
but it can't solve my problem.

How can I handle it?
Thanks in advance for any help.
:)
Regards,
Posted

Hi,

The application should exit nicely when quit is called. Few things to check:
- ensure that the application is visible in order to see if any dialogs pop up
- if you have made changes to the document either save them first or discard

You can also wire the ApplicationEvents2_Event_Quit event to see that the quit is received correctly.
 
Share this answer
 
Comments
Nish Nishant 10-Apr-11 10:26am    
Voted 5, proposed as answer.
Wendelius 10-Apr-11 10:39am    
Thanks :)
Try to save the PID and kill the proccess WINWORD.EXE with Process.Kill, and the PID you've saved.
 
Share this answer
 
Comments
Lương Thông Đạt 10-Apr-11 9:08am    
It's really a good solution :) I'll try to do it
Nish Nishant 10-Apr-11 10:26am    
This would be a brute force solution. I'd recommend that you follow Mika's advice first.
wILDFriCK 10-Apr-11 11:00am    
It's not a brute force if you save the PID of your process.
Quit is not always working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900