Platform SDK: Exchange 2000 Server

Updating Appointments and Meetings

[This is preliminary documentation and subject to change.]

You can update the properties and fields of an appointment or meeting that is saved in your calendar folder. For appointments, you overwrite the original appointment in the Web Store with the updated appointment. With meetings, you need to send the update to attendees in addition to saving the changes to the Web Store. If you are not the meeting organizer and you update a meeting in your calendar folder, any updates you accept from the meeting organizer overwrite your updates.

The basic process for updating appointments or meetings is as follows:

  1. Open an appointment or meeting in the Calendar folder as shown in Getting Appointments and Meetings from Folders in Exchange. Be sure to open the appointment in read/write mode using adModeReadWrite.
  2. Change the properties and fields of the appointment or meeting as desired.
  3. Save the appointment or meeting to the calendar folder using the IAppointment.Datasource.Save method.

The following code example checks all of the appointments and meetings in the calendar of user12 on the Exchange 2000 Server exsvr3 in the exchange.microsoft.com domain. It changes any appointment or meeting scheduled in the "Flamingo Room" to the "Mount Rainier Room" and saves the appointment.

[Visual Basic]
Dim CalendarURL As     String
Dim ItemURL     As     String
Dim Rs          As New ADODB.Recordset
Dim Rec         As New ADODB.Record
Dim Conn        As New ADODB.Connection
Dim iAppt       As New Appointment
Dim Target      As     String
Dim NewValue    As     String
Dim Location    As     String

Target = "Flamingo Room"
NewValue = "Mount Rainier Room"

  'Using the Exchange OLE DB provider
  CalendarURL = "file://./backofficestorage/gberg2.extest.microsoft.com/MBX/user12/calendar/"

'Open a record set for the items in the calendar folder
Rec.Open CalendarURL
Set Rs.ActiveConnection = Rec.ActiveConnection
Rs.Source = "SELECT ""DAV:href"", ""urn:schemas:calendar:location"" from scope('shallow traversal of """ & CalendarURL & """')"
Rs.Open

'Enumerate the record set, checking each item's location
Rs.MoveFirst
Do Until Rs.EOF
  'get the location of each item
  Location = Rs.Fields(CdoCalendar.cdoLocation).Value
  'test for desired location
  If (Location = Target) Then
    'open appointment in read/write mode and update the location property
    ItemURL = Rs.Fields(CdoDAV.cdoHref).Value
    iAppt.DataSource.Open ItemURL, , adModeReadWrite
    iAppt.Location = NewValue
    iAppt.DataSource.Save
  End If
  Rs.MoveNext
Loop