Skip to content

Instantly share code, notes, and snippets.

@thure
Last active August 29, 2015 14:27
Show Gist options
  • Save thure/63c16f64d086d62a1047 to your computer and use it in GitHub Desktop.
Save thure/63c16f64d086d62a1047 to your computer and use it in GitHub Desktop.
Public Sub AutoDeclineInvitation(Item As Outlook.MailItem)
Dim cAppt As AppointmentItem
Dim oResponse
Set cAppt = GetCurrentItem.GetAssociatedAppointment(False)
If cAppt.ReminderSet Then
Set oResponse = cAppt.Respond(olMeetingDeclined, True)
Else
GetCurrentItem.GetAssociatedAppointment(True)
Set oResponse = cAppt.Respond(olMeetingAccepted, True)
End If
oResponse.Send
Set cAppt = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment