Read (NotesCalendarEntry - LotusScript®)

Renders a calendar entry in iCalendar format.

Defined in



Set entry$ = notesCalendarEntry.Read( [ recurid$ ] )
Parameter Description
recurid String. The recurrence identifier (RECURRENCE-ID item) for a recurring calendar event. The format of a recurrence identifier is a time in UTC format, for example, 20120913T160000Z.
Return value Description
String The calendar entry in iCalendar format.
Possible exception (lsxbeerr.lss) Value Text Description
lsERR_NOTES_ERR_INVALIDID 4757 Invalid ID The identifier for the NotesCalendarEntry object is not valid.
lsERR_NOTES_ERR_RECURID_NOTFOUND 4808 Recurrence-ID not found The recurrence identifier for the NotesCalendarEntry object is not valid.
lsERR_NOTES_ERR_IDNOTFOUND 4814 Identifier not found The recurrence identifier for the NotesCalendarEntry object does not identify an entry in the calendar, or the scope and recurid are missing for a recurring entry.


This method returns complete iCalendar data for the entry. For recurring entries, the data may contain multiple VEVENT entries.


This agent reads the calendar entry for a given UID, or its first instance in the case of a recurring entry.
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim cale As NotesCalendarEntry
	Dim uid As String
	Dim calestr As String
	Dim recurid As String
	Dim i As Integer
	Dim db As NotesDatabase
	Dim doc As NotesDocument
	Dim body As NotesRichTextItem
	uid = session.Getenvironmentstring("currentuid")
	If uid = "" Then
		MessageBox "No current UID",, "Error"
		Exit sub
	End If
	recurid = session.Getenvironmentstring("currentrecurid")
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	Set cale = cal.Getentry(uid)
	If recurid = "" Then
		calestr = cale.Read()
		calestr = cale.Read(recurid)
	End If
	REM Write results to document
	Set db = session.Currentdatabase
	Set doc = db.Createdocument()
	doc.Form = "main"
	doc.Subject = "Calendar entry"
	Set body = doc.Createrichtextitem("body")
	Call doc.Save(true, true)
End Sub