Outlook Macro to save and send with one keystroke

0

I have a problem with G Suite Sync for Microsoft Outlook (GSSMO) that I gather is fairly common. My G Suite account works fine, but my IMAP accounts won't allow me to reply or forward emails, instead giving me a dialog "Could not complete the operation because the service provider does not support it." This problem only showed up after a couple of months. The only way to fix it was to recreate my entire profile, which is a large undertaking. I did that once, but am now looking for a workaround.

The only workaround is to Save an email (to Drafts) before sending it. I keep forgetting to hit Ctrl-S before Alt-S to send, so what I'm hoping for is a macro that would integrate those two simple functions into a single command that I could access using an otherwise unassigned keystroke - maybe Alt-G or Alt-Q would work? I'm not much good at VBA, and since Outlook doesn't enable recording of macros, I'm hoping a VBA wizard out there can enable this solution to help me and many others.

Dave Maltz

Posted 2016-12-21T23:53:07.847

Reputation: 1

Answers

0

If you install AutoHotKey then you can use the following script.

!q::
SetTitleMatchMode, 2
IfWinActive, Message
{
 send, {Control Down}
 send, s
 send, {Control Up}
 send, {Alt Down}
 send, s
 send, {Alt Up}
}
  • After installing AutoHotKey, save this script into a text file with extension .ahk
  • To run with Windows, put the script in your start menu Startup folder. Autohotkey also has a compiler to turn scripts into exe files, if that works better for you.
  • !q is the hotkey for Alt-Q. If the script is active, then whenever you hit Alt-Q, the script will run.
  • It will only run if the active window name contains with "Outlook".
  • It sends the key strokes that you specified.

Sir Adelaide

Posted 2016-12-21T23:53:07.847

Reputation: 4 758

Thanks - this looks promising, but didn't actually work once I got it running. I tried both an .exe and restarting, but maybe it's not recognizing the email window as "Outlook"? – Dave Maltz – 2016-12-22T18:46:26.187

sorry, should have done a little more testing. Title should be contain "Message" rather than "Outlook" as I'd set originally – Sir Adelaide – 2016-12-22T23:19:20.090

0

Below is an AutoHotkey script variation which remaps [Alt+S] to send [Ctrl+S followed by Alt+S].

A 200ms delay is shown in between because it is usually unnoticeable and can improve reliability and reduce unpredictable behavior for programs that can't process back-to-back keystrokes (usually when some action needs to happen in between the two--in this case saving the draft). The delay amount can be adjusted or removed as needed given your real-world results.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn  ; Recommended for catching common errors.
#Persistent
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

; Nothing else in the auto-execute section, just return...

Return

; Shortcut triggered by pressing Alt+s...
#IfWinActive, ahk_exe OUTLOOK.EXE   ; Outlook (any window) must be active
$!s::                ; $ = Force keyboard hook so won't retrigger itself
    Send ^s          ; Send Control+s
    Sleep 200        ; May need to adjust if it takes time to save the Draft
    Send !s          ; Send Alt+s
Return

JJohnston2

Posted 2016-12-21T23:53:07.847

Reputation: 1 341

Ahhh! That works, beautifully! Thank you so much - now I'll need to post this solution far and wide so others can find it. – Dave Maltz – 2016-12-22T18:52:10.013

And thanks to both you and Sir Adelaide for bringin Auto Hotkey to my attention - what a great program! – Dave Maltz – 2016-12-22T18:53:22.467