M
Michael Lorenz
Hello
Tryed to make a timer in VBA (Code listed at the end) But everytime I
restart my Outlook2003 after executing the right-working Timer I get a
message that the last time I closed Outlook there was an big error. Then VBA
is deactivated and I have to activate it again.
With OutlookXP at my company: it works. What to make different in
Outlook2003?
Thanks
Michael
Code:
Option Explicit
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal
nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal
nIDEvent As Long) As Long
Public THdl As Long
Public Sub StartApiTimer(ByVal mSec&)
THdl = SetTimer(0&, 0&, mSec, AddressOf TimerProc)
End Sub
Public Sub TimerProc(ByVal hWnd&, ByVal uMsg&, ByVal CurTHdl&, ByVal
CurSystemTime&)
Msgbox("it works")
End Sub
Public Sub StopApiTimer()
KillTimer 0&, THdl: THdl = 0
End Sub
Tryed to make a timer in VBA (Code listed at the end) But everytime I
restart my Outlook2003 after executing the right-working Timer I get a
message that the last time I closed Outlook there was an big error. Then VBA
is deactivated and I have to activate it again.
With OutlookXP at my company: it works. What to make different in
Outlook2003?
Thanks
Michael
Code:
Option Explicit
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal
nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal
nIDEvent As Long) As Long
Public THdl As Long
Public Sub StartApiTimer(ByVal mSec&)
THdl = SetTimer(0&, 0&, mSec, AddressOf TimerProc)
End Sub
Public Sub TimerProc(ByVal hWnd&, ByVal uMsg&, ByVal CurTHdl&, ByVal
CurSystemTime&)
Msgbox("it works")
End Sub
Public Sub StopApiTimer()
KillTimer 0&, THdl: THdl = 0
End Sub