VBOffice

Pause Code Execution

In Excel there's a function to stop the code execution for a determined time, which is missing in Outlook. See how to use the Sleep function of the Win32 API.

Last modified: 2007/07/20 | Accessed: 52.316  | #56
◀ Previous sample Next sample ▶

In Excel there's a function to stop the code execution for a determined time, in Outlook there isn't such a function. But you can use the Sleep function of the Win32 API, of course.


tip  How to add macros to Outlook
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliSeconds As Long)

Public Sub Test()
  Sleep 3000
  MsgBox "Hello"
End Sub
OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.
email  Send a message