Mark as read on delete in Outlook?

9,086

Hmm, I did it but won't get the bonus points I guess...

I'm running outlook 2010 so I could use a new feature called the "Quick Access" menu where you can define chains of actions as a single button with a shortcut key (unfortunally, it has to be Ctrl+Shift+NUM, so since I wanted this action to run when I press Delete, I had to do an extra step. See below.)

In Outlook 2007 you can still define macros. I stole this from another entry on the same subject:

http://www.formortals.com/outlook-macro-mark-as-read-delete/

Sub DeleteAndMarkAsRead()
    Dim oItem As Object
    Dim oMailItem As MailItem
    Dim oRSSItem As PostItem

    If Application.ActiveExplorer.Selection.Count = 0 Then
        Exit Sub
    End If

    For Each oItem In Application.ActiveExplorer.Selection
        If oItem.Class = olMail Then
            Set oMailItem = oItem
            oMailItem.UnRead = False
            oMailItem.Delete
        End If
    Next

    Set oItem = Nothing
End Sub

You can then add the macro as a button and assign a shortcut to it:

http://www.howto-outlook.com/howto/macrobutton.htm

Then to be able to run it when I press Delete, I used AutoHotKey and add the following to my script file:

#IfWinActive Inkorgen - 
    ;
    Del::       
        Send ^+1
    return
#IfWinActive

The part after #IfWinActive is the Caption (Title) of my Outlook window ("Inkorgen" is Swedish for "Inbox" FYI...) so you'll have to change it to reflect the Caption of your Outlook window.

The Send ^+1 tells AutoHotKey to simulate a Ctrl+Shift+1 keypress (that's the shortcut key for my macro (Quick Access Button)).

(There is a way of matching against the class name of the window (ahk_class), but this worked for me so I couldn't be bothered to find that out.)

Share:
9,086

Related videos on Youtube

x3ja
Author by

x3ja

x3jA | Alex

Updated on September 17, 2022

Comments

  • x3ja
    x3ja over 1 year

    I'd like Outlook to mark any messages I delete to be marked as read. For bonus points, I'd like it to only do this on messages that I have opened/previewed before pressing delete since this means I've looked at the content and chosen to delete it.

    I know I can set it to mark as read after x seconds when I'm looking at it, that's not what I want. I also know that I can move off the message & back on to it or right click to mark as read - still not what I want.

    I'm using Outlook 2007 in case that matters.

    [Edit: I just found I can at least mark as read with a keyboard shortcut: Ctrl-Q, but again, it'd be nice to not have to do this. More shortcuts here.]

    [Edit2: I am now on Outlook 2010 :)]

  • x3ja
    x3ja over 12 years
    As per edit just now on the question, I'm now on Outlook 2010 anyway. Thanks for the info :)
  • HaveSpacesuit
    HaveSpacesuit over 6 years
    Wow. An AutoHotKey script to mash the shortcut code for a custom VB macro. Quite clever! But it would be super nice for this feature to be a setting in Outlook someday.