WOOT! I figured it out.
It was the second and third parameters of the .Quit method. They needed to be "System.Reflection.Missing.Value".
There is no delay in closing Word or my program that is usually associated with automating Office from .NET and Word does close and there is no need for the ReleaseCOMObject.
VB Code:
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { object a = false; object r_missing = System.Reflection.Missing.Value; if (moApp.Documents.Count > 0) { moApp.Documents.Close(ref a, ref r_missing, ref r_missing); } moApp.Quit(ref a, ref r_missing, ref r_missing); moApp = null; }






Reply With Quote