Last active
June 10, 2023 12:52
-
-
Save ckunte/4f58679de506917fae17383bdc0b2691 to your computer and use it in GitHub Desktop.
Scripting replies in Outlook 2016 with AutoHotkey script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Scripting replies in Outlook 2016 with AutoHotkey | |
; Hit Ctrl + Win + r to create a reply email (template) with salutation to sender's | |
; First Name from selected / opened email in Microsoft Outlook, which looks like this: | |
; | |
; Hi <FirstName>, | |
; | |
; Thank you for your email. | |
; | |
; <Signature appears here, if set-up in Outlook> | |
; | |
^#r:: | |
ol := COMObjActive("Outlook.Application").ActiveExplorer.Selection.Item(1) | |
From := ol.SenderName | |
StringGetPos, pos, From, `, | |
if errorlevel | |
{ | |
StringGetPos, pos, From, %A_Space% | |
StringLeft, From, From, pos | |
} | |
else | |
{ | |
StringTrimLeft, From, From, pos+2 | |
} | |
StringUpper From, From, T | |
FirstName := RegExReplace(From, " .*", "") | |
SendInput, ^r | |
Sleep, 100 | |
SendInput, Hi %FirstName%, {Enter 2}Thank you for your email.{Enter 2} | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment