Discussion:
How to insert a delay in the middle of a word macro
(too old to reply)
Jasy
2005-06-29 15:45:06 UTC
Permalink
can anyone tell me how to put a delay in word macro.
for example after one step I need a delay of 500ms to execute the next line.

Jasy
Jay Freedman
2005-06-29 17:15:31 UTC
Permalink
Post by Jasy
can anyone tell me how to put a delay in word macro.
for example after one step I need a delay of 500ms to execute the next line.
Jasy
Put this at the start of the module, after Option Explicit, but before
the first Sub or Function :

Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" _

(ByVal dwMilliseconds As Long)


Then you can put a delay in your code like this


Sleep 500 ' 500 ms pause
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Doug Robbins
2005-06-29 19:57:14 UTC
Permalink
If this is required in connection with printing, it may be better to set the
BackgroundPrinting switch to False.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
Post by Jasy
can anyone tell me how to put a delay in word macro.
for example after one step I need a delay of 500ms to execute the next line.
Jasy
Loading...