Skip to content

Instantly share code, notes, and snippets.

@aejay
Created February 15, 2013 16:00
Show Gist options
  • Save aejay/4961311 to your computer and use it in GitHub Desktop.
Save aejay/4961311 to your computer and use it in GitHub Desktop.
Quick Outlook macro to automatically accept a meeting request, and notify you that it has been accepted. Use the Alt+F11 combo to pull up the VBA editor. To utilize the function, you will need to add a rule that uses the "Run a script" action.
Sub AutoAcceptMeetings(oRequest As MeetingItem)
If oRequest.MessageClass <> "IPM.Schedule.Meeting.Request" Then
Exit Sub
End If
Dim oAppt As AppointmentItem
Set oAppt = oRequest.GetAssociatedAppointment(True)
Dim oResponse
Set oResponse = oAppt.Respond(olMeetingAccepted, True)
oResponse.Save
oResponse.Send
MsgBox "You accepted a meeting request from " + oRequest.SenderName + ":\n" + oAppt.Subject + "\n" + oAppt.Start, vbInformation, "Meeting Request"
oRequest.Delete
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment