Sending Meeting Updates
Topic Last Modified: 2006-06-12
If you are the organizer of a meeting, you can send updates to the attendees of the meeting using a calendar message. Collaboration Data Objects (CDO) returns an error if you call the IAppointment.CreateRequest method for a meeting of which you are not the organizer.
Attendees process the update messages the same way they process any other calendar message. The ICalendarMessage.CalendarParts.GetUpdatedItem method compares the new calendar message with the existing meeting. It returns an Appointment object that can be saved to the calendar folder. The updated meeting overwrites the existing meeting. For more information about processing meeting updates, see Responding to a Meeting Request.
To send a meeting update
- Open the meeting, and then update the desired properties and fields as shown in Updating a Appointments and Meetings. Verify that you are the organizer of the meeting.
- Set the meeting configuration, and then create a Calendar Message object using the IAppointment.CreateRequest method. For a published appointment, use the Publish method instead of the CreateRequest method.
- Add any text you want to the Calendar Message object.
- Send the Calendar Message using the IMessage.Send method.
- Save the meeting update to the calendar folder.
The code in the following example checks all of the meetings in the calendar of user12, located on server exsvr3 in the exchange.example.com domain. For meetings originated by user12, this code changes any meeting in the "Flamingo Room" to the "Mount Rainier Room" and sends an update to all attendees.
Dim CalendarURL As String Dim ItemURL As String Dim Rec As New ADODB.Record Dim Rs As New ADODB.Recordset Dim iDsrc As CDO.IDataSource Dim iAtnds As CDO.IAttendees Dim Config As New CDO.Configuration Dim iAppt As New CDO.Appointment Dim iCalMsg As CDO.CalendarMessage Dim iMsg As CDO.Message Dim Target As String Dim NewValue As String Dim Location As String Dim Address As String Dim Index As Integer Target = "Flamingo Room" NewValue = "Mount Rainier Room" 'Using the Exchange OLE DB provider CalendarURL = "file://./backofficestorage/exchange.example.com/MBX/user12/calendar/" 'Set the configuration for the message Config.Fields(cdoSendEmailAddress) = "firstname.lastname@example.org" Config.Fields("CalendarLocation") = CalendarURL Config.Fields.Update 'set address of user for comparing with attendee value Address = "MAILTO:" & Config.Fields(cdoSendEmailAddress) 'Open a recordset 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 recordset, 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 organizer and desired location If (Location = Target) Then 'open appointment in read/write mode ItemURL = Rs.Fields(CdoDAV.cdoHref).Value Set iDsrc = iAppt iDsrc.Open ItemURL, , adModeReadWrite 'verify this user is organizer by checking attendee property Set iAtnds = iAppt.Attendees 'If appointment has attendess and this user is organizer send an update 'otherwise just save update to calendar If iAtnds.Count > 1 Then For Index = 1 To iAtnds.Count If iAtnds.Item(Index).IsOrganizer And iAtnds.Item(Index).Address = Address Then 'update the appointment location iAppt.Location = NewValue 'save the appointment iDsrc.Save 'set the configuration iAppt.Configuration = Config 'create a calendar message Set iCalMsg = iAppt.CreateRequest 'send the update to the attendees Set iMsg = iCalMsg.Message iMsg.TextBody = "Automated update - please note new location" iMsg.Send End If 'user is organizer Next Index Else 'appointment has only one attendee iAppt.Location = NewValue iDsrc.Save End If 'appointment has attendees End If 'location = target Rs.MoveNext Loop