Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Implementing an OnTimer Event Sink

Implementing an OnTimer Event Sink

Exchange Server 2003

Implementing an OnTimer Event Sink

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The following code handles and logs the OnTimer system event. See Store Event Sink Bit Flags for more information.

Visual Basic

Private Sub IExStoreSystemEvents_OnTimer(ByVal bstrURLItem As String, ByVal lFlags As Long)

    Dim FSO         As Object
    Dim EvtLog      As String
    Dim EvtFile

'Log file
    EvtLog = Environ("SystemDrive") & "\OnTimer.log"

'Creates new log file %SystemDrive%\OnTimer.log or opens it if exists
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set EvtFile = FSO.OpenTextFile(EvtLog, 8, True)

'Append incoming event info into log file
    EvtFile.WriteLine ("[VB Event Sink]          OnTimer()")
    EvtFile.WriteLine ("  lFlags:                " & "0x" & Hex(lFlags))

    EvtFile.WriteBlankLines (1)

'Before Quit
    EvtFile.Close
    Set FSO = Nothing

End Sub

Show:
© 2015 Microsoft