This documentation is archived and is not being maintained.

GetAssociatedAppointment Method

Office 2003

Returns an AppointmentItem object that represents the appointment associated with the meeting request.


expression     Required. An expression that returns a MeetingItem object.

AddToCalendar    Required Boolean. True to add the meeting to the default Calendar folder.


This Visual Basic for Applications (VBA) example finds a MeetingItem in the default Inbox folder that has not been responded to yet and adds the associated appointment to the Calendar folder. It then responds to the sender by accepting the meeting.

Sub AcceptMeeting()
	Dim myOlApp As New Outlook.Application
	Dim myNameSpace As Outlook.NameSpace
	Dim myFolder As Outlook.MAPIFolder
	Dim myMtgReq As Outlook.MeetingItem
	Dim myAppt As Outlook.AppointmentItem
	Dim myMtg As Outlook.MeetingItem
	Set myNameSpace = myOlApp.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)
	End If
End Sub

If you use Microsoft Visual Basic Scripting Edition (VBScript) in a Microsoft Outlook form, you do not create the Application object, and you cannot use named constants. This example shows how to obtain the associated appointment item for a meeting request using VBScript code.

Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(6)
Set myMtgReq = myFolder.Items.Find _
    ("[MessageClass] = 'IPM.Schedule.Meeting.Request'")
If TypeName(myMtgReq) <> "Nothing" Then
   Set myAppt = myMtgReq.GetAssociatedAppointment(True)
End If

Applies to | MeetingItem Object