AppointmentItem.Respond (Outlook)

Responds to a meeting request.

When you call the Respond method with the olMeetingAccepted or olMeetingTentative parameter, Outlook will create a new appointment item that duplicates the original appointment item. The new item will have a different Entry ID. Outlook will then remove the original item. You should no longer use the Entry ID of the original item, but instead call the EntryID property to obtain the Entry ID for the new item for any subsequent needs. This is to ensure that this appointment item will be properly synchronized on your calendar if more than one client computer accesses your calendar but may be offline using the cache mode occasionally. The following table describes the behavior of the Respond method depending on the parent object, and the fNoUI and fAdditionalTextDialog parameters.

Respond (Response, fNoUI, fAdditionalTextDialog)


Sub AcceptMeeting() 
 Dim myNameSpace As Outlook.NameSpace 
 Dim myFolder As Outlook.Folder 
 Dim myMtgReq As Outlook.MeetingItem 
 Dim myAppt As Outlook.AppointmentItem 
 Dim myMtg As Outlook.MeetingItem 
 
 Set myNameSpace = Application.GetNamespace("MAPI") 
 Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox) 
 Set myMtgReq = myFolder.Items.Find("[MessageClass] = 'IPM.Schedule.Meeting.Request'") 
 If TypeName(myMtgReq) <> "Nothing" Then 
 Set myAppt = myMtgReq.GetAssociatedAppointment(True) 
 Set myMtg = myAppt.Respond(olResponseAccepted, True) 
 myMtg.Send 
 End If 
End Sub

Arguments

The following argument is required

Response (OlMeetingResponse) - The response to the request.

Possible return values are olMeetingAccepted - The meeting was accepted, olMeetingDeclined - The meeting was declined, olMeetingTentative - The meeting was tentatively accepted.

Optional arguments

The following arguments are optional

fNoUI (Boolean) - True to not display a dialog box; the response is sent automatically. False to display the dialog box for responding.

fAdditionalTextDialog (Boolean) - False to not prompt the user for input; the response is displayed in the inspector for editing. True to prompt the user to either send or send with comments. This argument is valid only if fNoUI is False.