>Neil
>
>FWIW, and since I am asking a question here too, there is another way that does not require polling etc:
>
>
>loshell=CREATEOBJECT("WScript.Shell")
>loshell.run("myfilename.doc",3,.t.)
>*---stops here until Word is closed
>messagebox("You closed word!")
>
This is not reliable, since if Word is already running, it invokes an MDI instance of Word, and Shell.Run, which relies on ShellExecuteEx(), can't determine the proper processid or threadid related to your running Windows instance. You'll get an "OLE IDispatch error code 0 from Wscript.Run - unable to wait for process" if an instance of Word is already running.