Article ID: 171127
Article Last Modified on 1/20/2007
Sub IsTaskRunning()
' If file does not exist, GoTo error trap.
On Error GoTo itrErrTrap
' Run sample batch file in MS-DOS window.
Shell "c:\test.bat"
Do
' Note: When specifying the Application name
' with the Exists(Name) argument, omit the
' Application extension.
test = Tasks.Exists("test")
Loop Until test = 0
MsgBox "The application has quit."
itrErrTrap: ' Note: This line must be left aligned.
If Err > 0 then MsgBox Err.Description
End Sub
79696 Using Shell Statement to Access MS-DOS Prompt from WinWord
72287 Using AppActivate to Switch to Another Application
Additional query words: wordcon 8.0 vba vbe vb
Keywords: kbcode kbhowto kbinterop kbmacro kbmacroexample kbprogramming KB171127