If you’ve ever used Outlook’s archiving feature, you may have noticed that a lot of emails that should have been archived are left behind. For example, you tell it to archive anything older than Dec 31, 2014, yet emails older than that still remain in the original folder.
The reason for this is that Outlook’s default behavior is to archive based on the “Last Modified” date, which means that if you made any sort of modification to the email after the specified archive date then email won’t be archived. What’s a modification? It could be something as simple adding or removing a flag. Supposedly some anti-virus apps also cause this date to change.
I think everyone’s intuitive understanding of the way archiving should work, is that the mail is archived depending on when you got/sent it, no matter what you did with it afterward. Luckily, you can tell Outlook to use this more intuitive method by adding a simple entry to your registry.
The registry setting is called ArchiveIgnoreLastModifiedTime, and it’s registry location depends on the version of Outlook you’re using.
For Outlook 2007, please follow Knowledge Base article 2500686. Make sure you have at least SP3 installed.
For Outlook 2010 or 2013, please follow Knowledge Base article 2553550.
My Outlook is connected to an Exchange account that accepts emails for multiple domains. When I open up the emails, Outlook always displays my name in the To field, but doesn’t show which email (i.e. which domain) the mail was actually sent to.
I decided that manually checking the mail headers for this information was a dumb way to do things, so I wrote a little macro to automate this little task. Hopefully some of you out there will find it useful.
- Press Alt+F11
- On the left hand side, expand the tree until you see ThisOutlookSession. Make sure ThisOutlookSession is highlighted.
- Paste the code from below
- Close the Visual Basic window
- Attach the new macro to a toolbar item. The way to do this varies with your version of Outlook. For example, in Outlook 2007:
- Open any email
- Press the down arrow on the right side of the quick access toolbar
- Select “More Commands”
- In the “Choose Commands From” dropdown, select “Macros”
- Add the macro to the right hand side
- (Optional) Change the icon by highlighting the macro and selecting Modify.
- You can add the macro either to the “view email” screen as I explained above, or to the toolbar of the main inbox screen.
Dim olSelection As Outlook.Selection
Set olSelection = Application.ActiveExplorer.Selection
If olSelection.Count = 1 Then
Dim oItem As Object
Set oItem = olSelection(1)
If (oItem.MessageClass = "IPM.Note") Then
Dim RegEx As Object, oMatches As Object
Dim Headers As String
Dim oMail As Outlook.MailItem
Set oMail = oItem
Headers = oMail.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E")
Set RegEx = CreateObject("VBScript.RegExp")
RegEx.Pattern = "To: (.+)"
RegEx.IgnoreCase = True
Set oMatches = RegEx.Execute(Headers)
If (oMatches.Count >= 1) Then
MsgBox "This message was sent to: " & oMatches(0).SubMatches(0)
MsgBox "Error: Could not fine the To header."
MsgBox "Error: This macro only works on emails."
MsgBox "Error: This macro doesn't work if you select more than one item."
Added Dec 17: To ensure the macro isn’t blocked by the Outlook macro security settings, follow the instructions in this article to sign your own macros.
If you have a modern keyboard, it most likely has a Mail key on the top row which will launch your mail client. I prefer to use this key not only as a means to launch my mail client, but also as a shortcut for switching to it.
Unfortunately, by default, if Outlook is your mail client, hitting the Mail key repeatedly opens multiple copies of Outlook. Fortunately, the fix is easy:
- Launch the Registry Editor by hitting Win+R and typing regedit in the dialog box.
- When the Registry Editor opens, navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AppKey\15. (You should see the following value there: Association=mailto)
- From the Edit menu pick New -> String Value
- In Name, type ShellExecute
- In Data, type outlook.exe /recycle
That’s it! You can now hit the Mail key multiple times.
I use Microsoft keyboards but this should hopefully work with other manufacturers’ keyboards as well.
Tip: Don’t install the special Microsoft Keyboard software that came with your keyboard or that is offered to you via Windows Update – it will mess things up.