In our company we are using Windows application to generate Word (2010) documents. Sometimes the document is not properly closed, so another application (yes, they still cal
You can try to set the focus in one of those windows and send the keys Alt F4 to Close those processes
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx
there are several ways to get handles to the windows of the processes.
Good luck
You need to attach to the running Word instance as described here, and then close the document:
$wd = [Runtime.Interopservices.Marshal]::GetActiveObject('Word.Application')
$wd.Documents | ? { $_.Name -eq 'some.docx' } | % {
$_.Saved = $true
$_.Close()
}
This must be run in the context of the user who started the application, and it will only attach to the instance started first (usually there's only one instance running anyway). You'd need to quit that instance first before you can attach to the instance started second.