Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sarah - 01 Mar 2005 19:45 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.