Skip to content

Instantly share code, notes, and snippets.

@jfrmilner
Created February 3, 2022 17:43
Show Gist options
  • Save jfrmilner/f2137616a30cfe02d5655ce7c977206c to your computer and use it in GitHub Desktop.
Save jfrmilner/f2137616a30cfe02d5655ce7c977206c to your computer and use it in GitHub Desktop.
AutoHotKey - Hotkey to Accept Outlook Meeting
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;jfrmilner hotkeys
;^ = Ctrl, ! = ALT, # = Win, + = Shift
;Shift+F7
+f7::
objOL := ComObjActive("Outlook.Application").ActiveExplorer.Selection.Item(1) ; Selected message in Outlook
objOLAp := objOL.GetAssociatedAppointment(True)
ResponseStatus := objOLAp.ResponseStatus ; Subject ;https://docs.microsoft.com/en-us/office/vba/api/outlook.olresponsestatus
objOLAp.Respond(olResponseAccepted := 3) ; 3 = The meeting was accepted. https://docs.microsoft.com/en-us/office/vba/api/outlook.olmeetingresponse
objOLAp.Send
if (objOLAp.ResponseStatus == 3) {
objOL.UnRead := False
objOL.Delete
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment