Or... using the Delete key to file messages.
Let me go on record as saying I think using the Delete key to file messages is a bad idea. But I know there are a lot of people doing it. A lot less since the introduction of Quick Steps, but still too many use the Delete key as a way to quickly clear out the Inbox.
Create a Quick Step
My recommended method with Outlook 2010 and 2013: create a quick step (and assign it a shortcut) to move stuff you want to keep and only use the Deleted Items folder for stuff you don't need to keep.
Once you get in the habit, Ctrl+Shift+1 can be second nature, although it is a little difficult for smaller hands to manage one-handed. If your mouse or keyboard supports programmable keys you might be able to reprogram a key for the shortcut.
Macro to move Deleted Items
This is for a user who uses the Delete key to file messages but her company cleans up the mailboxes nightly, emptying the Deleted items folder.
The macro moves all mail dropped in the deleted items folder to a folder under the Inbox.
Note: with this macro active, the only way to delete anything is by using Shift+Delete to permanently delete. It could be tweaked to look for messages meeting certain conditions, such as marked complete or assigned a category, and move (or not move) those items.
Private WithEvents Items As Outlook.Items Private Sub Application_Startup() Dim NS As Outlook.NameSpace Set NS = Application.GetNamespace("MAPI") Set Items = NS.GetDefaultFolder(olFolderDeletedItems).Items Set NS = Nothing End Sub Private Sub Items_ItemAdd(ByVal Item As Object) If TypeOf Item Is Outlook.MailItem Then Set fldMove = Session.GetDefaultFolder(olFolderInbox). _ Folders("Deleted Stuff") Item.Move fldMove End If End Sub
Move messages using a Toolbar button
Although not as easy as the Del key, you can use a toolbar button to move messages to an archive folder. In versions of Outlook that use the traditional toolbar, you can assign a keyboard shortcut. In ribbonized versions, you can add the macro to the QAT and use Alt+ the number representing its position on the QAT.
This sample moves messages from the Inbox to a subfolder named "completed".
To use this macro, you need the GetCurrentItem function at Work with Open Item or Selected Item
Sub MoveDeleted() Dim objOutlook As Outlook.Application Dim objNamespace As Outlook.NameSpace Dim objSourceFolder As Outlook.MAPIFolder Dim objDestFolder As Outlook.MAPIFolder Dim objItem As MailItem Set objOutlook = Application Set objNamespace = objOutlook.GetNamespace("MAPI") Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderInbox) ' Get GetCurrentItem function athttp://slipstick.me/e8mio Set objItem = GetCurrentItem() Set objDestFolder = objNamespace.GetDefaultFolder(olFolderInbox).Folders("completed") objItem.Move objDestFolder Set objDestFolder = Nothing End Sub
How to use the macro
First: You will need macro security set to low during testing.
To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security. If Outlook tells you it needs to be restarted, close and reopen Outlook. Note: after you test the macro and see that it works, you can either leave macro security set to low or sign the macro.
Now open the VBA Editor by pressing Alt+F11 on your keyboard.
To use the macro code in ThisOutlookSession:
- Expand Project1 and double click on ThisOutlookSession.
- Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
Application_Startup macros run when Outlook starts. If you are using an Application_Startup macro you can test the macro without restarting Outlook by clicking in the first line of the Application_Startup macro then clicking the Run button on the toolbar or pressing F8.
To put the code in a module:
- Right click on Project1 and choose Insert > Module
- Copy and paste the macro into the new module.
More information as well as screenshots are at How to use the VBA Editor