Script to remove cancelled meetings from User mailbox

Senario - We would like a mailbox where our helpdesk can go to look at meeting setups for the day.

We created a user mailbox called IT resource Aggregate and have one resource forwarding any meeting invites to the IT resource Aggregate.  We have turned on, on the client side auto accept meetings etc.  and it is doing just that which is perfect im half way there.  However when I cancel the meeting and send the update the resource does it job and removes the meeting from its CAL and again forwards a copy to IT resource Aggregate mailbox.  The IT resource Aggregate mailbox marks the meeting in its CAL as cancelled but does not remove it from its own Calendar.  I was wondering if there is a script out there that can help me at the very least remove the meeting from the Cal of the IT resource Aggregate mailbox.

Or is there another way of automating this process?

All mailboxes are in O365 not sure if that matters but I wanted to mention it.
Who is Participating?
David LeeCommented:
The best explanation is that the path you provided is invalid.  Add the following code to the code you already have.

Sub GetFolderPath()
    Dim olkFol As Outlook.MAPIFolder
    Set olkFol = Application.ActiveExplorer.CurrentFolder
    MsgBox "The path to the currently selected folder is" & vbCrLf & vbCrLf & olkFol.FolderPath, vbInformation + vbOKOnly, "Get Folder Path"
    Set olkFol = Nothing
End Sub

Open in new window

Once you've done that, select the folder you want and run the GetFolderPath macro.  It will display the path to the selected folder.  Copy and paste that path into the first bit of code and you should be in business.
David LeeCommented:
jgutierr76Author Commented:
I edited the mailboxname:

Set olResCalendar = OpenMAPIFolder("\ITRESAGG\Calendar")

But i get a run time error.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.