Share via


Addressing a Calendar Message

Topic Last Modified: 2006-06-12

You can add attendees to a meeting by using the Attendees collection of the Appointment object. The Attendees collection can contain one or more attendees. You can use the same Attendee object to add each attendee.

When you create a CalendarMessage object requesting a meeting, the message is automatically addressed to each attendee in the Attendees collection.

To add attendees to an appointment

  1. Create an Attendee object.
  2. Set the properties of the Attendee object.
  3. Add each attendee by using the same Attendee object.

The following example shows how to add attendees to an appointment and then generate a meeting request.

Example

Visual Basic

Dim iAppt      As New Appointment
Dim iAttendee  As Attendee

' Add a required attendee.
Set iAttendee = iAppt.Attendees.Add
iAttendee.Address = "someone@example.com"
iAttendee.Role = cdoRequiredParticipant

' Add an optional attendee.
Set iAttendee = iAppt.Attendees.Add
iAttendee.Address = "another@example.com"
iAttendee.Role = cdoOptionalParticipant
' ...

C++

IAppointmentPtr iAppt(__uuidof(Appointment));
IAttendeePtr iAttn;

// Add a required attendee.
// Set the e-mail address during the addition step.
iAttn = iAppt->Attendees->Add(bstr_t(strEmailAddr));
iAttn->Role = cdoRequiredParticipant;
cout << "Attendee e-mail address (MAILTO:): " << iAttn->Address << endl;

// Add an optional attendee.
iAttn = iAppt->Attendees->Add(bstr_t());
iAttn->Address = "another@example.com";
iAttn->Role = cdoOptionalParticipant;
// ...