How can I switch between "All" and "Unread" in my Outlook 2013 inbox?

I would like to switch between seeing All and just Unread emails in my Outlook 2013 inbox using just the keyboard and a single key combo, for instance Ctrl+Shift+A and Ctrl+Shift+U (just an example).

Is there such a shortcut, or is it possible to create one?

The closest I have gotten is Ctrl+E to go to the search box, then Shift+Tab to jump to Unread and Shift-Tab again to get to All, then Space to select. Cumbersome!


Solution 1:

You could map a few simple Macros in AutoHotkey with something like this:

#SingleInstance
#Persistent
SetTitleMatchMode 2

Hotkey, IfWinActive, Outlook ahk_class rctrl_renwnd32, NUIDocumentWindow
Hotkey, +u, ViewUnreadLabel
Hotkey, +a, ViewReadLabel
Hotkey, IfWinActive

SafeToRunMacro() {
    IfWinActive, ahk_class rctrl_renwnd32
    {
        ControlGetFocus, CurrentCtrl
        CtrlList = Acrobat Preview Window1,AfxWndW5,AfxWndW6,EXCEL71,MsoCommandBar1,OlkPicturePreviewer1,paneClassDC1,RichEdit20WPT2,RichEdit20WPT4,RichEdit20WPT5,RICHEDIT50W1,SUPERGRID1,SUPERGRID2,AfxWndW16,OutlookGrid1,NetUIHWND4
        if CurrentCtrl in %CtrlList%
        {
            Return, True
        } else {
            Return, False
        }
    }
}

ViewUnreadFunc(NormalKey) {
    if SafeToRunMacro() {
        ControlClick, OutlookGrid1, ahk_class rctrl_renwnd32,,,, NA x60 y5
    } else {
        Send %NormalKey%
    }
}

ViewReadFunc(NormalKey) {
    if SafeToRunMacro() {
        ControlClick, OutlookGrid1, ahk_class rctrl_renwnd32,,,, NA x5 y5
    } else {
        Send %NormalKey%
    }
}

ViewUnreadLabel:
    ViewUnreadFunc(A_ThisHotkey)
Return

ViewReadLabel:
    ViewReadFunc(A_ThisHotkey)
Return

If you're interested you can compile this into a .exe file and start it each time you start your PC. I'm working currently on implementing this into my Outlook GTD tool. If you're interested you can learn more at AutoGTD.com

Solution 2:

So I wound up using a combination of the above tips, thanks everyone!

  • Created a custom view for only unread messages
  • Created a macro to switch between ordinary compact view and only unread messages view
  • Created a Quick Access Toolbar button for the macro, which can be used via Alt+the number corresponding to the buttons placement on the QAT.

This is the macro:

Sub SkifteView()

Dim ns As Outlook.NameSpace
Set ns = Application.GetNamespace("MAPI")

Dim Exp As Outlook.Explorer
Set Exp = Application.ActiveExplorer

Dim myInbox As Folder
Set myInbox = ns.GetDefaultFolder(olFolderInbox)

Set Exp.CurrentFolder = myInbox

If Application.ActiveExplorer.CurrentView.Name = "Compact" Then
   Application.ActiveExplorer.CurrentView = "Only unread"
Else
    Application.ActiveExplorer.CurrentView = "Compact"
End If
End Sub