Remove Cancelled Meeting Requests from Resource Calendar

Last reviewed on May 22, 2012

When someone cancels a meeting, the cancellation notice removes the meeting from the attendees calendar automatically but does not remove it from the resource calendar. This is to preserve a historical list of use for resource planning purposes and shows users possible conflicts. For more information see, OL2000: (CW) Cancelled Meeting Remains on Resource Account Calendar (applies to all versions of Outlook).

Microsoft recommends using a custom view to hide cancelled meetings from users.

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.

Exchange 2007 & 2010 Server

Administrators can use RemoveOldMeetingMessages parameter to remove cancelled meetings from resource calendars on Exchange 2007 or Exchange 2010, as the meetings are canceled.

Please note that this applies to meetings cancelled after setting RemoveOldMeetingMessages to true. 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. It also will not remove meetings created by Direct Booking (where the user opens the room calendar), the resource needs to be invited.

In Exchange 2007, use the Set-MailboxCalendarSettings cmdlet:

Set-MailboxCalendarSettings -Identity "room1" -RemoveOldMeetingMessages $true

In Exchange 2010, use the Set-CalendarProcessing cmdlet:

Set-CalendarProcessing -Identity "room1" -RemoveOldMeetingMessages $true

Macro to remove cancelled meetings

This macro will search through a resource calendar and delete items with "Canceled:" in the subject. You also must have proper permissions on the resource mailbox for this to work.

This macro will remove cancelled meetings will remove both direct booking and autoaccepted meetings.

Don't forget to change this line to the correct mailbox name:
Set olResCalendar = OpenMAPIFolder("\MailboxName\Calendar")

Sub RemoveCanceledAppointments()
Dim olResCalendar As Outlook.MAPIFolder, olApptItem As Outlook.AppointmentItem, intCounter As Integer

'Change the path to the resource calendar on the next line
Set olResCalendar = OpenMAPIFolder("\MailboxName\Calendar")

For intCounter = olResCalendar.Items.Count To 1 Step -1
Set olApptItem = olResCalendar.Items(intCounter)
	If Left(olApptItem.Subject, 9) = "Canceled:" Then
		olApptItem.Delete
	End If
Next
Set olApptItem = Nothing
Set olResCalendar = Nothing
End Sub

Function OpenMAPIFolder(szPath)
Dim app, ns, flr, szDir, i
Set flr = Nothing
Set app = CreateObject("Outlook.Application")
	If Left(szPath, Len("\")) = "\" Then
		szPath = Mid(szPath, Len("\") + 1)
	Else
		Set flr = app.ActiveExplorer.CurrentFolder
	End If
	
While szPath <> ""
i = InStr(szPath, "\")
	If i Then
		szDir = Left(szPath, i - 1)
		szPath = Mid(szPath, i + Len("\"))
	Else
		szDir = szPath
		szPath = ""
	End If
	If IsNothing(flr) Then
		Set ns = app.GetNamespace("MAPI")
		Set flr = ns.Folders(szDir)
	Else
		Set flr = flr.Folders(szDir)
	End If
	Wend
Set OpenMAPIFolder = flr
End Function

Function IsNothing(Obj)
If TypeName(Obj) = "Nothing" Then
	IsNothing = True
Else
	IsNothing = False
End If
End Function

How to use the RemoveCanceledAppointments macro

The RemoveCanceledAppointments macro will search through a resource calendar and delete all canceled appointment items. It searches the resource calendar, looking for appointments with a subject beginning with "Canceled:". 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.

If a cancellation notice wasn't sent, then there is no way to know if a meeting was canceled.

Before beginning, if your macro security settings are not configured to allow macros to run, you'll need to take care of this:

  1. Go to Tools, Macro, Security
  2. Set the Security Level to Medium
  3. Close Outlook
  4. Restart Outlook

Depending on your version of Outlook, you may need to restart it in order to use the macro.

Next you'll need to

  1. Add the resource mailbox to your profile. You must have permissions on the resource mailbox for this to work.
  2. Press Alt+F11 to open the VB editor
  3. If not already expanded, expand ThisOutlookSession
  4. Copy the macro and paste it into the right-hand pane of the VB Editor
  5. Edit the macro as needed (Remember to change the mailbox name!)
  6. Save the changes
  7. Run the macro (press F5 to run it in the VB Editor)

More Information

Cancelled Meeting Remains on Resource Account Calendar (KB, applies to all versions of Outlook)

Managing Automatic Meeting Responses For Outlook 2010. While this does not address the cancelled meeting problem, it may be helpful for anyone who makes heavy use of meetings.

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999 and involved in IT support since 1985, Diane is the author of several books and video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.