A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

pause in script



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 23rd 06, 04:38 PM posted to microsoft.public.outlook.program_vba
Joel Allen
external usenet poster
 
Posts: 117
Default pause in script

Hello,

I just want to add a 5 second pause in my script. Can someone point me to
some sample code - I couldn't find the command?

Thank you,
Joel


Ads
  #2  
Old February 24th 06, 07:04 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default pause in script

Am Thu, 23 Feb 2006 07:38:11 -0800 schrieb Joel Allen:

Joel, one method would be to use the Sleep API but that stops not your
function, but the whole thread the function is running in.

Another approach is to split your code and use the timer API, summary:

sub f1()
' execute first part
' if the first part is ready call the timer
end function

sub timer_callback()
' method called by the timer after 5 seconds e.g.
' call f2 now
end sub

sub f2()
' execute the rest here
end sub

Sample (with German comments):
http://www.vboffice.net/sample.html?...4&cmd=showitem

If you use that timer you need to ensure that the timer is really stopped
before Outlook closes! (In the scenario above no problem, simply stop the
timer before calling f2.)

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hello,

I just want to add a 5 second pause in my script. Can someone point me to
some sample code - I couldn't find the command?

Thank you,
Joel

  #3  
Old February 24th 06, 02:37 PM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 28
Default pause in script

On Thu, 23 Feb 2006 07:38:11 -0800, Joel Allen wrote in
microsoft.public.outlook.program_vba:

I just want to add a 5 second pause in my script. Can someone point me to
some sample code - I couldn't find the command?


This is what I use:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
and then
Sleep 5000 ' Sleep 5 seconds

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #4  
Old February 24th 06, 03:46 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default pause in script

Although if this is truly script code (VBScript) none of the Win32 API calls
can be used.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Michael Bednarek" wrote in message
...
On Thu, 23 Feb 2006 07:38:11 -0800, Joel Allen wrote in
microsoft.public.outlook.program_vba:

I just want to add a 5 second pause in my script. Can someone point me to
some sample code - I couldn't find the command?


This is what I use:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
and then
Sleep 5000 ' Sleep 5 seconds

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"


  #5  
Old February 25th 06, 06:56 AM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 28
Default pause in script

On Fri, 24 Feb 2006 09:46:19 -0500, Ken Slovak - [MVP - Outlook] wrote
in microsoft.public.outlook.program_vba:

Although if this is truly script code (VBScript) none of the Win32 API calls
can be used.


I pondered that, too. But the name of this newsgroup is
microsoft.public.outlook.program_vba and the original message wasn't
crossposted, so I thought it might help.

"Michael Bednarek" wrote in message
.. .
On Thu, 23 Feb 2006 07:38:11 -0800, Joel Allen wrote in
microsoft.public.outlook.program_vba:

I just want to add a 5 second pause in my script. Can someone point me to
some sample code - I couldn't find the command?


This is what I use:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
and then
Sleep 5000 ' Sleep 5 seconds


--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
  #6  
Old February 26th 06, 08:46 PM posted to microsoft.public.outlook.program_vba
Joel Allen
external usenet poster
 
Posts: 10
Default pause in script

I am in the Script Editor of my custom task form. Not sure if thats VB
script or not.

Thanks,
Joel

"Michael Bednarek" wrote in message
...
On Fri, 24 Feb 2006 09:46:19 -0500, Ken Slovak - [MVP - Outlook] wrote
in microsoft.public.outlook.program_vba:

Although if this is truly script code (VBScript) none of the Win32 API
calls
can be used.


I pondered that, too. But the name of this newsgroup is
microsoft.public.outlook.program_vba and the original message wasn't
crossposted, so I thought it might help.

"Michael Bednarek" wrote in message
. ..
On Thu, 23 Feb 2006 07:38:11 -0800, Joel Allen wrote in
microsoft.public.outlook.program_vba:

I just want to add a 5 second pause in my script. Can someone point me
to
some sample code - I couldn't find the command?

This is what I use:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
and then
Sleep 5000 ' Sleep 5 seconds


--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"



  #7  
Old February 27th 06, 07:28 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default pause in script

Am Sun, 26 Feb 2006 19:46:04 GMT schrieb Joel Allen:

Then that´s VBScript and you can´t use Win32 API calls as Ken mentioned.

The WSH has a sleep method that you can use.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


I am in the Script Editor of my custom task form. Not sure if thats VB
script or not.

Thanks,
Joel

"Michael Bednarek" wrote in message
...
On Fri, 24 Feb 2006 09:46:19 -0500, Ken Slovak - [MVP - Outlook] wrote
in microsoft.public.outlook.program_vba:

Although if this is truly script code (VBScript) none of the Win32 API
calls
can be used.


I pondered that, too. But the name of this newsgroup is
microsoft.public.outlook.program_vba and the original message wasn't
crossposted, so I thought it might help.

"Michael Bednarek" wrote in message
...
On Thu, 23 Feb 2006 07:38:11 -0800, Joel Allen wrote in
microsoft.public.outlook.program_vba:

I just want to add a 5 second pause in my script. Can someone point me
to
some sample code - I couldn't find the command?

This is what I use:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
and then
Sleep 5000 ' Sleep 5 seconds


--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
script event does not fire urs Outlook - General Queries 2 March 1st 06 05:55 PM
QUERY: export script KevinGPO Outlook - General Queries 3 March 1st 06 02:38 PM
Script in Rule clarkel Outlook and VBA 2 February 2nd 06 09:20 PM
Script Joel Allen Outlook and VBA 0 January 27th 06 07:53 PM
script editor not open Ertan Gökalp Outlook - Using Forms 0 January 9th 06 10:12 AM


All times are GMT +1. The time now is 08:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.