December 1, 2021

Outlook: How to flag an email as complete with a hotkey

I like to use email flagging in Microsoft Outlook quite a lot and there I love to have a custom hotkey for handling it. I share how to achieve this: one implemented with AutoHotkey in the PowerTool Outlook Shortcuts and one implemented in VBA.

N.B.: you could also use a quick step to do this. The advantage is that you can then combine the flagging with marking the item as read (and move to a folder optional - which I don't do because I prefer to hide completed emails automatically.). The drawback is, that you can not assign a hotkey to a Quick Step (afaik).

AutoHotkey Implementation

Code

#IfWinActive, ahk_exe OUTLOOK.EXE
; Ctrl+D: Mark complete
^d:: ; <--- Mark Complete/ Done
If WinActive("Reminder(s) ahk_class #32770"){ ; Reminder Windows
; Keys are blocked by the UI: c,d,a,s. Alt does not work
    WinActivate
    Send +{F10} ; Shift+F10 - Open Context Menu
    Send m ; Mark Complete
    WinSet Bottom
} else if WinActive("Inbox - ") or WinActive("Tasks - ") WinActive("To-Do List - ") {
    Send +{F10} ; Shift+F10
    Send u
    Send m
}  
return

This is implemented in OutlookShortcuts.ahk

The key part of the implementation relies upon opening the context menu with Shift+F10 and then trigger the proper action menu via the accelerator keys.

This only works for one last selected item.

Usage

In Outlook, for example in your Inbox when an email is selected simply hit the Ctrl+D hotkey to mark it as complete.

VBA Implementation

Alternatively, you can implement this in VBA. 

Code

The code is pretty simple.

You can get the code in this outlook-vba repository the Email.bas module. It also requires GetCurrentItems in Utils.bas.

Setup

You can set this macro as a button in the QAT (Quick Access Toolbar (QAT). 

You can also trigger it with a hotkey. (If you press the Alt key they become highlighted.)

This works for multi-selection. (hold the Ctrl key)

(You could also remap this hotkey Alt+QAT # in your AutoHotkey script.)

See also

Outlook: Hide Completed Emails in Inbox

Assign a macro to a button


No comments:

Post a Comment