avoid Word to appear hung up
-
Hy everyone! I do have a macro on a quit long document (several 100 pages), which searches this document quit often before it is finished. So this could take quit long until it is done. When I do leave Word during the macro is running, I am not able to get back e.g. to have a look when it might be ready or to have a look into what is displayed in the statusbar. I do show status informations in the status bar. I thought this would avoid Word to appear hung up because of changing the contains, but it didn't. Same problem when the screensaver starts. What I want to do is the following: Allow to leave the Word window and reenter it at any time, as if I never left it. Is there any chance to avoid Word to appear hung up when the macro is running and I left the window? Or do I have to wait until the macro is ready to enter the window again? Because I do want to be able to have a look at the statusbar at any time to see the status of the macro and switch windows meanwhile. I would like to integrate this into my existing VBA for Word macro! Thanks for any idea! Stephan.
-
Hy everyone! I do have a macro on a quit long document (several 100 pages), which searches this document quit often before it is finished. So this could take quit long until it is done. When I do leave Word during the macro is running, I am not able to get back e.g. to have a look when it might be ready or to have a look into what is displayed in the statusbar. I do show status informations in the status bar. I thought this would avoid Word to appear hung up because of changing the contains, but it didn't. Same problem when the screensaver starts. What I want to do is the following: Allow to leave the Word window and reenter it at any time, as if I never left it. Is there any chance to avoid Word to appear hung up when the macro is running and I left the window? Or do I have to wait until the macro is ready to enter the window again? Because I do want to be able to have a look at the statusbar at any time to see the status of the macro and switch windows meanwhile. I would like to integrate this into my existing VBA for Word macro! Thanks for any idea! Stephan.
Yuo can call
DoEvents()
every once in a while to let Word process its WM_PAINT events. But, if your code is blocked on a long-running Search statement, this won't do you any good. If your code is blocked, your code is hung and so is Word, waiting for the statement to complete. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome