Article ID: 184747
Article Last Modified on 5/12/2003
Methods: LogEvent,
StartLogging.
Properties: AppMode,
AppPath.
This article addresses some of the common issues associated with these
properties and methods and provides an event logging example that
demonstrates their use.
'=========================== CODE FOR FORM1 ==========================
Private Sub Command1_Click()
'Default logging without specifying LogPath or LogMode.
With App
.LogEvent "Default Logging " & Now, vbLogEventTypeInformation
.LogEvent .LogPath
.LogEvent .LogMode
End With
End Sub
Private Sub Command2_Click()
'Logging to a file by specifying LogPath and LogMode
'in the StartLogging method call.
With App
.StartLogging "c:\temp\logtest.log", 2
'LogMode = 2 should be the same as vbLogToFile,
'but vbLogToFile constant is not defined as shown
'in books online.
.LogEvent "Specified Path File Logging " & Now,
vbLogEventTypeInformation
.LogEvent .LogPath
.LogEvent .LogMode
End With
End Sub
Private Sub Form_Load()
Command1.Caption = "Default Logging"
Command2.Caption = "Specified Path"
End Sub
'======================== END OF CODE FOR FORM1 =======================
Additional query words: LogPath LogMode StartLogging LogEvent
Keywords: kbinfo KB184747