Processing Meeting Cancellations

Processing Meeting Cancellations

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

As the organizer of a meeting, you can send a calendar message to cancel a meeting. Cancellation messages are calendar messages identified by the ICalendarPart.CalendarMethod value "CANCEL."

Instead of deleting the meeting from their calendars, attendees save the updated appointment object that has a MeetingStatus property set to Cancelled. Calendar client programs typically do not display canceled meetings. For example, Microsoft® Outlook® ignores canceled meetings when building calendar views. Collaboration Data Objects (CDO) does not automatically delete canceled meetings from the Exchange store.

To process a meeting cancellation

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

The code in the following example checks the inbox of user12 on a Microsoft Exchange Server 2003 named exsvr3, in the exchange.example.com domain. It opens all meeting cancellations and saves the updated meeting. Then it deletes the calendar message from the inbox.

Visual Basic

Note  The following example uses a file URL with the Exchange OLE DB (ExOLEDB) provider. The ExOLEDB provider also supports The HTTP: URL Scheme. Using The HTTP: URL Scheme allows both client and server applications to use a single URL scheme.

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
Dim Config       As New Configuration

InboxURL = "file://./backofficestorage/exchange.example.com/MBX/user12/inbox/"
CalendarURL = "file://./backofficestorage/exchange.example.com/MBX/user12/calendar/"

'Set the configuration fields for the appointment objects
Config.Fields(cdoSendEmailAddress) = "user12@exchange.example.com"
Config.Fields("CalendarLocation") = CalendarURL
Config.Fields.Update

'Open a recordset for the items 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 & """')"
Rs.Open

'Enumerate the recordset, checking each item's content class
Rs.MoveFirst
Do Until Rs.EOF
  'get the content class of each item
  ContentClass = Rs.Fields("DAV:contentclass").Value
  'test content class for calendar message
  If ContentClass = "urn:content-classes:calendarmessage" Then
    'open calendar message
    ItemURL = Rs.Fields(CdoDAV.cdoHref).Value
    iCalMsg.DataSource.Open ItemURL
    iCalMsg.Configuration = Config
    Debug.Print "Message subject: " & iCalMsg.Message.Subject
    'get each calendar part
    For Index = 1 To iCalMsg.CalendarParts.Count
      Set iCalPart = iCalMsg.CalendarParts(Index)
      Set iAppt = iCalPart.GetUpdatedItem
      Select Case iCalPart.CalendarMethod
        Case "CANCEL"
         'Save the appointment
         iAppt.DataSource.Save
        Case Else
          'see other examples in this section
      End Select

    Next Index

    'Delete the calendar message
    Rs.Delete
  End If

Rs.MoveNext
Loop

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.