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 / November 2005

Tip: Looking for answers? Try searching our database.

How to build a delay into a code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex@name.ext - 15 Nov 2005 15:39 GMT
Hi

I'd like to pause a Winword macro until a specific time. I tried something
like

   Application.Wait Now + TimeValue("00:00:10")

and it came with the compilation error "Method or data member not found".
Is it only for Excel?

Besides, this seems to be a busy wait which blocks the PC, which I have to
avoid, because it will run on a Terminal Server.

Why "Application.Wait" doesn't work and what is a better way to build a
delay in the code?

TIA

Alex
Helmut Weber - 15 Nov 2005 15:53 GMT
Hi Alex,

there is no wait method for, at least Word 2003.

See (one line):

http://groups.google.de/group/microsoft.public.word.vba.general/browse_frm/threa
d/2da3ec34d799084b/c65fff652f61f0d8?lnk=st&q=wait+sleep+group:microsoft.public.w
ord.vba*+author:helmut+author:weber&rnum=2&hl=de#c65fff652f61f0d8


http://groups.google.de/group/microsoft.public.word.vba.userforms/browse_frm/thr
ead/8f61fdba80b62014/7796586a79857a6a?lnk=st&q=wait+sleep+group:microsoft.public
.word.vba*+author:helmut+author:weber&rnum=1&hl=de#7796586a79857a6a


Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Tony Jollans - 15 Nov 2005 15:55 GMT
Application.Wait is Excel.

In Word you can use Application.OnTime to fire a procedure at a given time.
With appropriate flags and jumps you could arrange to make it act like a
delay.

--
Enjoy,
Tony

> Hi
>
[quoted text clipped - 15 lines]
>
> Alex
Alex - 15 Nov 2005 20:57 GMT
Thanks Helmut and Tony.

Sleep "kernel32" seems OK.

As to Application.OnTime , I was under the impression it is a busy wait,
but i'll check again.

Anyway, many thanks to both of you.

Alex
 
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.