You should always call Quit.
Because it's an out of process server, rather than an in-process server,
releasing references will not unload the application, you will need to
explicitly call the quit. Be careful that winword isn't prompting for user
input too, this will cause it to hang and not unload.
Hi,
I am diligently releasing (Marshal.ReleaseComObject (o) ) all references I
pick up while generating a report using VB.NET in my software. At least, I
*think* I am. However, when I have finished using the WINWORD.EXE com
server, I still have a reference to it hanging somewhere in my code (I know
this because it remains in task manager). I have checked and double checked
but can't find it (although of course I am sure it must be there somewhere).
So my question is: are there any tools or is there any programmatic method I
can use to determine whether or not I have any references to this process
alive as a result of my code?
Oddly, even after I quit my program, WINWORD.EXE remains in memory.
However, if after creating my report, viewing it and then manually closing
WORD I check the task manager, it has mysteriously gone. Should I therefore
always call "quit" on the application object model, or will just releasing
the reference to it suffice?
Thanks for any information you can give me.
Robin.
Crouchie1998 - 18 Jan 2005 00:29 GMT
Yes, objWord.Quit for example & then to double-check objWord = Nothing
Obviously, I am using objWord as a variable to explain a point. You should
change it to whatever you've called it
> You should always call Quit.
> Because it's an out of process server, rather than an in-process server,
[quoted text clipped - 23 lines]
>
> Robin.