I have a process that runs and takes a long time.
I would like to display a message and change the cursor while the user waits.
Wht kind of message box or other feature could i use to do this and how
would i fit it in with my code?
This is the code for the sub procedure:
Public Sub ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
Dim ReturnValue
' Initialize the STARTUPINFO structure:
start.dwFlags = STARTF_USESHOWWINDOW
start.cb = Len(start)
start.wShowWindow = 6
' Start the shelled application:
ReturnValue = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
' Wait for the shelled application to finish:
Do
ReturnValue = WaitForSingleObject(proc.hProcess, 0)
DoEvents
Loop Until ReturnValue <> 258
ReturnValue = CloseHandle(proc.hProcess)
End Sub
Doug Robbins - 02 Mar 2005 00:10 GMT
See the article "Implementing a Progress Bar in Word VBA" at:
http://word.mvps.org/FAQs/Userforms/CreateAProgressBar.htm

Signature
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
>I have a process that runs and takes a long time.
> I would like to display a message and change the cursor while the user
[quoted text clipped - 25 lines]
> ReturnValue = CloseHandle(proc.hProcess)
> End Sub