Platform SDK: Exchange 2000 Server

Processing Meeting Responses

[This is preliminary documentation and subject to change.]

The organizer of a meeting receives the responses to meeting requests from attendees. The organizer then needs to process the responses of each attendee to update their status. Because attendees can invite other attendees, a meeting organizer should be able to process responses from attendees the organizer did not invite.

When you call the ICalendarPart.GetUpdatedItem method, CDO searches your calendar folder for an existing meeting that matches a meeting in the calendar part. CDO builds an appointment object in memory that contains the latest information from the saved meeting and the new meeting. The response to your meeting request, (accepted, declined, tentative) is merged into the existing meeting. When you save the appointment object in memory using the Datasource.Save method, the meeting in your calendar folder contains the updated attendee status.

Meeting responses are calendar messages identified by the ICalendarPart.CalendarMethod value "REPLY."

The basic process for processing meeting responses is as follows:

  1. Open each meeting in the calendar message as shown in Processing a Calendar Message.
  2. Save the meeting returned by GetUpdatedItem.
  3. Delete the calendar message after processing all calendar parts.

The following code example checks the inbox of a specific user. It then opens all meeting responses and saves the updated attendee status. Finally, it deletes the calendar message from the inbox.

[Visual Basic]
Dim InboxURL     As String
Dim CalendarURL  As String
Dim ItemURL      As String
Dim Rs           As New ADODB.Recordset
Dim Rec          As New ADODB.Record
Dim iCalMsg      As New CalendarMessage
Dim iCalPart     As ICalendarPart
Dim iAppt        As Appointment
Dim Index        As Integer
Dim ContentClass As String

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

'Open the record set for the calendar messages in the inbox folder
Rec.Open InboxURL
Set Rs.ActiveConnection = Rec.ActiveConnection
Rs.Source = "SELECT ""DAV:href"",""DAV:contentclass"" " & _
  "FROM scope('shallow traversal of """ & InboxURL & """')" & _
  "WHERE (""DAV:contentclass"" = 'urn:content-classes:calendarmessage')"
Rs.Open , , , adLockOptimistic

'Enumerate the recordset and process each calendar message
Rs.MoveFirst
Do Until Rs.EOF
  'Open the calendar message
  ItemURL = Rs.Fields(CdoDAV.cdoHref).Value
  iCalMsg.DataSource.Open ItemURL
  'Get each calendar part
  For Index = 1 To iCalMsg.CalendarParts.Count
    Set iCalPart = iCalMsg.CalendarParts(Index)
    Set iAppt = iCalPart.GetUpdatedItem(CalendarURL)
    Select Case iCalPart.CalendarMethod
      Case "REPLY"
       'Save the appointment
       iAppt.DataSource.Save
      Case Else
        'See the other examples in this section
    End Select

  Next Index

  'Delete the calendar message
  Rs.Delete

Rs.MoveNext
Loop