Respond Method (MeetingItem Object)

The Respond method returns a MeetingItem object for responding to this meeting request.

Syntax

Set objMeetResp = objMeeting.Respond(RespondType)

objMeetResp

Object. On successful return, contains a MeetingItem object that can be used to respond to the meeting request.

objMeeting

Required. This MeetingItem object.

RespondType

Required. Long. The value to send as the response.

Remarks

The Respond method prepares a meeting response which can be sent in answer to a meeting request using the Forward or Send method. The response takes the form of a MeetingItem object with the meeting's initiating user as a primary recipient. The initiating user is available through the Organizer property of the associated AppointmentItem object, which can be obtained from the GetAssociatedAppointment method.

The RespondType parameter can have exactly one of the following values:

RespondType setting

Decimal value

Description

CdoResponseAccepted

3

This messaging user wishes to firmly accept the meeting request.

CdoResponseDeclined

4

This messaging user wishes to decline the meeting request.

CdoResponseTentative

2

This messaging user wishes to tentatively accept the meeting request.

The message class of the response you send depends on the value you specify in the RespondType parameter. It is IPM.Schedule.Meeting.Resp.Pos if you accept, IPM.Schedule.Meeting.Resp.Neg if you decline, or IPM.Schedule.Meeting.Resp.Tent if you accept tentatively.

You can respond to the same meeting request more than once. If you call the Respond method with the the RespondType parameter set to CdoResponseAccepted or CdoResponseTentative, CDO creates an AppointmentItem object associated with the meeting and saves it in your active calendar folder. You can use the Respond method on this appointment to change your response.

If you Respond to a meeting request with CdoResponseDeclined, no AppointmentItem object is created, but any AppointmentItem already in the folder is left undeleted. Therefore, if you accept a request and subsequently decline it, or if you call GetAssociatedAppointment on the meeting request and then respond with CdoResponseDeclined, you must either Delete the associated AppointmentItem object yourself or leave it in the folder.

Note

The Exchange Server 2003 SP2 version of CDO 1.2.1 handle calendar items differently than earlier versions of Exchange Server 2003. See Calendaring Changes in CDO 1.2.1 for more information.

If you have declined a meeting request and subsequently wish to accept it, you cannot use any associated AppointmentItem object for your new response. However, if you have retained the requesting MeetingItem object, you can use its Respond method to accept the request.

If a meeting request is for a recurring meeting, your response applies to the entire recurring series. If you respond with CdoResponseAccepted or CdoResponseTentative, you can subsequently select an individual recurrence and alter your response to CdoResponseAccepted, CdoResponseTentative, or CdoResponseDeclined.

You cannot call Respond on a meeting cancellation, that is, a meeting request with CdoMeetingCanceled in its associated appointment's MeetingStatus property.

Another messaging user can delegate you to receive messages on behalf of that user. This delegation cannot be done with CDO but is possible using MAPI. If you have been so delegated and receive a meeting request for that user, you can view the MeetingItem object in your Inbox, but you cannot accept the meeting request. Similarly, if you access the Inbox of a messaging user that has delegated reception to you, you can view meeting requests but not respond to them. In either of these cases, an attempt to call GetAssociatedAppointment or Respond returns CdoE_NO_SUPPORT.

Calendar folders are not supported in the public folders store provided with Microsoft® Exchange, and MeetingItem objects are stored as Message objects. An attempt to call Respond in this case returns CdoE_NO_SUPPORT.

Calling the Respond method is the same as calling GetAssociatedAppointment and then calling Respond on the AppointmentItem object.

Example

Dim objSess As Session
Dim objMtg As MeetingItem
Dim objAppt As AppointmentItem
Dim objResp As MeetingItem ' response to meeting request
On Error Resume Next

Set objSess = CreateObject("MAPI.Session")
objSess.Logon
Set objMtg = objSess.Inbox.Messages(1)

If objMtg Is Nothing Then
  MsgBox "No messages in Inbox"
  ' ... error exit ...
ElseIf objMtg.Class <> 27 Then ' CdoMeetingItem
  MsgBox "Message is not a meeting request or response"
  ' ... error exit ...
End If
MsgBox "Meeting is " & objMtg ' default property is .Subject

' Message exists and is a meeting; is it a request?
If objMtg.MeetingType <> 1 Then ' CdoMeetingRequest
  MsgBox "Meeting item is not a request"
  ' ... error exit ...
End If
Set objAppt = objMtg.GetAssociatedAppointment
MsgBox "Meeting times" & objAppt.StartTime & " - " & objAppt.EndTime _
                       & "; recurring is " & objAppt.IsRecurring
' we can Respond from either the AppointmentItem or the MeetingItem
Set objResp = objMtg.Respond(3) ' CdoResponseAccepted
objResp.Text = "OK, I'll be there"
objResp.Send
 

See Also

Concepts

MeetingItem Object