A friend of mine heard that I developed a macro that can move a message into another folder with the click of a key and asked me to blog about it. The macro is simple. To create a macro in Outlook, pull down the Tools menu, select Macro, and select Visual Basic Editor. Or, just type Alt+F11.
Create a macro, I called mine MoveToRead. It looks like this:
Sub MoveToRead() On Error Resume Next Dim objNS As Outlook.NameSpace Dim objInbox As Outlook.MAPIFolder Dim objFolder As Outlook.MAPIFolder Dim objItem As Object Set objNS = Application.GetNamespace("MAPI") Set objInbox = objNS.GetDefaultFolder(olFolderInbox) Set objFolder = objInbox.Folders("Read") If objFolder Is Nothing Then MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation, "INVALID FOLDER" End If For Each objItem In Application.ActiveExplorer.Selection objItem.Move objFolder Next End Sub
The script may need to be modified to suit your needs. For instance, “Read” might not be the folder where you want to send your e-mails. Also, I originally used Outlook.mailItem for objItem instead of Object, but I found that meeting invites wouldn’t get moved. As long as the item has a Move method,using Object assures it will get called. On Error Resume Next assures you won’t get a nasty dialog if you try this on an object that can’t be moved (though I can’t think of any).
To invoke the macro, I found that I couldn’t just assign a global key, at least not the key I wanted: Alt+S. To do this, I had to create a menu item called &Send to Read and use the standard Windows menu-invoke-via-keyboard mechanism to call the Macro via Alt+S. I picked Alt+S specifically because I can move items to read with my left hand as I use Â the mouse with m y right. This makes things very quick.