AutoAcceptMeetingRequests then uses the Respond method with the fNoUI parameter set to true to indicate that a response will be sent automatically to accept the meeting request.
In the following code example, AutoAcceptMeetingRequests enumerates through every MeetingItem object to get the associated AppointmentItem. The fNoUI and fAdditionalTextDialog parameters are bool values that determine whether a response will be sent, and whether the user may or may not edit the response, respectively. The Response parameter indicates whether the response is accept, decline, or tentative. The Respond method accepts three parameters. Then use the Respond(OlMeetingResponse, Object, Object) method of the AppointmentItem to notify the meeting organizer whether the meeting has been accepted, declined, or tentatively added to the recipient’s calendar. To respond to a meeting request, use the GetAssociatedAppointment(Boolean) method to obtain the AppointmentItem associated with the meeting request. It works in all versions of Outlook and can be used on Exchange 2007 and Exchange 2010 resource mailboxes, if the RemoveOldMeetingMessages parameter is not set to true.The following code example is an excerpt from Programming Applications for Microsoft Office Outlook 2007.Ī MeetingItem object represents a request to add an appointment, represented by an AppointmentItem object, to a recipient’s calendar. It searches the resource calendar, looking for appointments with a subject beginning with "Canceled:". The RemoveCanceledAppointments macro will search through a resource calendar and delete all canceled appointment items.
Set flr = Įnd Function How to use the RemoveCanceledAppointments macro Set app = CreateObject("Outlook.Application") If Left(olApptItem.Subject, 9) = "Canceled:" Then Set olApptItem = olResCalendar.Items(intCounter) 'Change the path to the resource calendar on the next lineįor intCounter = To 1 Step -1 Set olResCalendar = OpenMAPIFolder("\MailboxName\Calendar")ĭim olResCalendar As Outlook.MAPIFolder, olApptItem As Outlook.AppointmentItem, intCounter As Integer This macro will remove cancelled meetings will remove both direct booking and autoaccepted meetings.ĭon't forget to change this line to the correct mailbox name: You also must have proper permissions on the resource mailbox for this to work.
This macro will search through a resource calendar and delete items with "Canceled:" in the subject. Set-MailboxCalendarSettings -Identity "room1" -RemoveOldMeetingMessages $true
In Exchange 2007, use the Set-MailboxCalendarSettings cmdlet: Set-CalendarProcessing -Identity "room1" -RemoveOldMeetingMessages $true In Exchange 2010 and newer, including Office 365 Exchange online, use the Set-CalendarProcessing cmdlet: It also will not remove meetings created by Direct Booking (where the user opens the room calendar), the resource needs to be invited. It will not remove items cancelled previously these will need to be removed manually, either using the macro or a filtered view that displays only canceled meetings. Please note that this applies to meetings cancelled after setting RemoveOldMeetingMessages to true.
Note the Free/Busy should update (on the next scheduled Free/Busy publish) to reflect the cancelled meeting (the time will be shown as Free), so leaving the cancelled meetings in place should not affect scheduling.Īdministrators can set the RemoveOldMeetingMessages parameter to remove cancelled meetings from resource calendars as the meetings are canceled.