Dim currentLog As New NotesLog( "Database log" )
Dim count As Integer
Call currentLog.OpenNotesLog( "", "agentlog.nsf" )
Call currentLog.LogError( 1, "This is error number one" )
Call currentLog.LogError( 2, "This is error number two" )
Call currentLog.LogError _
( 3, "This is error number three" )
count = currentLog.NumErrors
Sub Initialize
Dim session As New NotesSession
Dim agent As NotesAgent
Dim db As NotesDatabase
Dim doc As NotesDocument
Set agent = session.CurrentAgent
Set db = session.CurrentDatabase
Dim currentLog As New NotesLog _
( "Log for " & agent.Name )
Call currentLog.OpenNotesLog( "", "agentlog.nsf" )
'...log some actions and errors...
Set doc = New NotesDocument( db )
doc.Form = "Memo"
doc.Subject = agent.Name & " logged " & _
currentLog.NumErrors & " errors"
Call doc.Send( False, agent.Owner )
End Sub