Platform SDK: Exchange 2000 Server

Creating Recurring Appointments and Meetings

[This is preliminary documentation and subject to change.]

Recurring appointments and meetings occur more than once following a pattern. For example, a department meeting on the first Tuesday of each month can be defined as a recurring meeting.

In CDO, a recurring appointment or meeting is represented by a single Appointment object and one or more RecurrencePattern objects. The Appointment object defines the first appointment or meeting, and the RecurrencePattern objects define the pattern for additional appointments. You can also specify modifications to the recurring meeting pattern using one or more Exception objects.

To create a recurring appointment or meeting

  1. Create an Appointment object.
  2. Set the properties of the first appointment or meeting.
  3. Create a RecurrencePattern object using the Add method on the RecurrencePatterns collection of the Appointment object.
  4. Set the properties of the RecurrencePattern object to create the desired pattern.
  5. For meetings, create one or more Attendee objects and specify the attendees.
  6. For meetings, create a Calendar Message object using the CreateRequest method and send the message.
  7. Save the appointment or meeting to the organizer's calendar (optional).

The following code example creates a meeting request for a recurring meeting. Meetings are every other Friday from 10:00 AM to 11:30 AM, starting October 10, 1999 and ending December 24, 1999.

[Visual Basic]
Dim iAppt       As New Appointment
Dim Config      As New Configuration
Dim RRULE       As IRecurrencePattern
Dim iCalMsg     As CalendarMessage
Dim iAttendee   As New Attendee
Dim CalendarURL As String

CalendarURL = "file://./backofficestorage/" & DomainName & "/MBX/" & UserName & "/calendar/"

'Set the configuration fields
Config.Fields(cdoSendEmailAddress) = UserName & "@" & DomainName
Config.Fields.Update
iAppt.Configuration = Config

'Set the first appointment properties
iAppt.StartTime = #10/15/1999 10:00:00 AM#
iAppt.EndTime = #10/15/1999 11:30:00 AM#
iAppt.Subject = "Department meeting"
iAppt.Location = "Oak Room"

'Create the RecurrencePattern object
Set RRULE = iAppt.RecurrencePatterns.Add("Add")

'Define the recurrence pattern
RRULE.Frequency = cdoWeekly  'use a weekly pattern
RRULE.Interval = 2  'every 2 weeks
RRULE.PatternEndDate = #12/24/1999 11:30:00 AM# 'the last appointment

'Add an attendee
Set iAttendee = iAppt.Attendees.Add
iAttendee.Address = "someone@" & DomainName
iAttendee.Role = cdoRequiredParticipant

'Create the calendar message and send it
Set iCalMsg = iAppt.CreateRequest
iCalMsg.Message.Send

'Save the appointment to the organizer's calendar
iAppt.DataSource.SaveToContainer CalendarURL