we need for our school project a way to start a word instance and track if the document was closed. The COM api from word doens't have a event for this, are there any other ways to do this?
Currently we're using the COM api from word, but everything else would be fine. We're programing in C#.
Use the winword process to check if process running on particual file is exited or not.
If you dont know the process of newly started instance use this or simply hook exited event of process.
Get all word processes
var info = Process.GetProcessesByName("winword").FirstOrDefault();
Identify the process of particular file using Process.MainWindowTitle
Hook exited event of the process Process.Exited
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With