Skip to content

Instantly share code, notes, and snippets.

@thure
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save thure/63c16f64d086d62a1047 to your computer and use it in GitHub Desktop.

Select an option

Save thure/63c16f64d086d62a1047 to your computer and use it in GitHub Desktop.

Revisions

  1. thure revised this gist Aug 19, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion silently-decline-invitation.vb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Sub AutoDeclineInvitation()
    Public Sub AutoDeclineInvitation(Item As Outlook.MailItem)
    Dim cAppt As AppointmentItem
    Dim oResponse

  2. thure created this gist Aug 19, 2015.
    17 changes: 17 additions & 0 deletions silently-decline-invitation.vb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    Sub AutoDeclineInvitation()
    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