GetNewInvitations (NotesCalendar - LotusScript®)

Gets calendar entries that are new invitations.

Defined in



Set invitationsVariant = notesCalendar.GetNewInvitations( [ startNotesDateTime ] , [ sinceNotesDateTime ] )
Parameter Description
start NotesDateTime. The start time for meetings to which any new invitations apply. Defaults to all meetings.
since NotesDateTime. The since time for any new invitations. Defaults to all new invitations. Use this parameter in conjunction with UntilTime to get invitations posted since the last call.
Return value Description
Variant The new invitations, or an empty array for no invitations. Each array element is of type NotesCalendarNotice.


It is important to remember that:
  • The first parameter applies to meetings and specifies the first date to be included in the search.
  • The second parameter applies to invitations and specifies the last date to be excluded from the search.


This agent gets calendar invitations for messages starting on January 1, 2012, and invitations since October 1 at midnight. The agent then gets more invitations since the last one processed as the user desires.
Sub Initialize
	REM On Error GoTo handler
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim cal As NotesCalendar
	Dim dt1 As NotesDateTime
	Dim dt2 As NotesDateTime
	Dim invites As Variant
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	Set dt1 = session.createdatetime("01/01/2012 00:00 AM")
	Set dt2 = session.createdatetime("10/01/2012 00:00 AM")
	invites = cal.Getnewinvitations(dt1, dt2)
		If IsEmpty(invites) Then
			MessageBox "No invitations",, "Nothing"
			Dim invite As NotesCalendarNotice
			Dim i As Integer
			On Error Resume Next
					For i = LBound(invites) To UBound(invites)
						Set invite = invites(i)
						MessageBox invite.Read(),, "Invitation"
		End If
		if (MessageBox(|Do you want to get new invitations since | & _
		cal.Untiltime.Localtime & |?|, MB_YESNO, "Again?") = IDNO) Then
			Exit do
		End if
		invites = cal.Getnewinvitations(dt1, cal.Untiltime)
	Exit Sub
	MsgBox Error,, Err()
	Exit sub
End Sub