This blog has moved
This blog has moved to http://rdingwall.name. You should be automatically redirected in a second or two, but if not, click here!
on the path to software development enlightenment
This blog has moved to http://rdingwall.name. You should be automatically redirected in a second or two, but if not, click here!
Posted by
Richard Dingwall
at
12:30 am
0
comments
Recently, I have been using GMail as my primary e-mail client. It's simple to use, lightweight, fast and powerful. One feature I particularly like is the Archive button, which lets me clear messages out of my inbox with a single click. Instead of letting e-mails clutter up my inbox just in case I need them again, I can archive them as soon as I've read them. Fewer items in my inbox makes it easier to focus and prioritize tasks, which in turn makes me more productive.
In the high-pressure environment at work, where I frequently receive up to a hundred or so e-mails a day, everything I can do to make my life easier helps. Here is how I added an Archive button to Microsoft Outlook:
Option Explicit
Public Sub ArchiveSelectedItems()
MoveSelectedItemsToFolder "Archive"
End Sub
Private Sub MoveSelectedItemsToFolder(FolderName As String)
On Error GoTo ErrorHandler
Dim Namespace As Outlook.Namespace
Set Namespace = Application.GetNamespace("MAPI")
Dim Inbox As Outlook.MAPIFolder
Set Inbox = Namespace.GetDefaultFolder(olFolderInbox)
Dim Folder As Outlook.MAPIFolder
Set Folder = Inbox.Folders(FolderName)
If Folder Is Nothing Then
MsgBox "The '" & FolderName & "' folder doesn't exist!", _
vbOKOnly + vbExclamation, "Invalid Folder"
End If
Dim Item As Object
For Each Item In Application.ActiveExplorer.Selection
If Item.UnRead Then Item.UnRead = False
Item.Move Folder
Next
Exit Sub
ErrorHandler:
MsgBox Error(Err)
End SubNow the archive macro has been created. Let's add a button that will trigger it:
All done!
Posted by
Richard Dingwall
at
8:12 pm
0
comments
Labels: E-mail, Outlook, Productivity