Sometimes you need tp pause a macro and, when you do, try the Sleep function.
This involves a call to the Windows API – sounds much more difficult than it is.
In your macro, go to the General Declarations area (the top part of the module) and type this, verbatim:
Private Declare Sub Sleep Lib “kernel32” (ByVal dwMilliseconds As Long)
Now, in your routine, when you want to put a pause, type:
sleep n where n is the number of milliseconds to pause for.
So, this macro will beep, pause for 1000 milliseconds and beep again.. it does it twice just in case you missed it the first time:
sub testMyAPIcall()
beep
sleep 1000
beep
sleep 1000
beep
end sub
Easy when you know how!
Excellent help. Thanks.
Hi Helen. This article came up in my Google search and was exactly what I was looking for. Thanks for posting.
No use on Word 2010 x64
Thanks so much for keeping this post alive. Saved my wife’s bacon!