This agent gets calendar and scheduling information for the
current user for today and tomorrow.Sub Initialize
Dim session As New NotesSession
Dim maildb As New NotesDatabase("", "")
Dim cal As NotesCalendar
Dim dt1 As NotesDateTime
Dim dt2 As notesdatetime
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesRichTextItem
REM Get calendar for current user
Call maildb.Openmail()
Set cal = session.getCalendar(maildb) ' Not In ref pane
Set dt1 = session.createdatetime("Today 08")
Set dt2 = session.Createdatetime("Tomorrow 17")
Set db = session.CurrentDatabase
REM Create document to post results
Set doc = db.CreateDocument
doc.Form = "main"
doc.Subject = "Today 08"
Set body = doc.Createrichtextitem("body")
REM Read range and put in body of document
Call body.Appendtext(cal.ReadRange(dt1, dt2))
Call doc.Save( True, True )
End Sub