Dim session As New NotesSession
Dim agent As NotesAgent
Dim agentName As String
Set agent = session.CurrentAgent
agentName = agent.Name
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim agent As NotesAgent
Set db = session.CurrentDatabase
Set agent = session.CurrentAgent
Dim currentLog As NotesLog
Set currentLog = New NotesLog( agent.Name )
Call currentLog.OpenMailLog _
( agent.Owner, agent.Name & " in " & db.Title )
'...log some actions and errors...
Call currentLog.Close
End Sub