I am inserting a word document into a word document by doc.InlineShapes.AddOLEObject.
doc.InlineShapes.AddOLEObject(System.Type.Missing, filename, true, false, System.Type.Missing, System.Type.Missing, System.Type.Missing, range);
It inserts the embedded document,but after closing the main word file, WINWORD.EXE process still running. How to solve this problem.. can anyone please help me?
Best How To :
I bielive the issue is related to not releasing uinderlying COM objects in the code. Use System.Runtime.InteropServices.Marshal.ReleaseComObject to release a Word object when you have finished using it. Then set a variable to Nothing in Visual Basic (null in C#) to release the reference to the object. See Office application does not quit after automation from Visual Studio .NET client for more information about the issue.