This agent script logs actions and errors to a database, and sends
an e-mail memo to the agent's owner letting her know how many actions
the script logged. For example, if Susanna Tallan owns the Thread
Agent and it logs five actions, the script sends a mail memo to Susanna
with "Thread Agent logged 5 actions" in the Subject.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.NumActions & " actions"
Call doc.Send( False, agent.Owner )
End Sub