The Respond method returns a MeetingItem object for responding to this meeting request.
Set objMeetResp = objMeeting.Respond(RespondType)
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. If you respond 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.
You cannot call Respond on a meeting cancellation, that is, a meeting request with CdoMeetingCanceled in its associated appointment's MeetingStatus property.
Calling the Respond method is the same as calling GetAssociatedAppointment and then calling Respond on the AppointmentItem object.
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