Sunday, February 17, 2008

HOW TO Organize the Thousand E-mails you get a Week

Do you get hundreds, if not thousands of e-mails a week? Most people do nowadays and the whole task of organizing e-mail actually has become such a burden for most people that they don’t even do it anymore. Does spending hours organizing just for organization’s sake increase productivity? I tend to believe it doesn’t. And following the guidelines of Productivity Gurus such as Sally McGhee is virtually impossible if you get thousands of e-mails a week like I do (see: http://www.microsoft.com/atwork/manageinfo/email.mspx). I agree with her that everyone should schedule some uninterrupted time to perform this task, but it should never be more than half an hour a week. Try using Sally’s approach if you have 1000 e-mails. That would take hours!
To address this issue I created an Inbox categorization macro a while ago, which helps me reduce my e-mail clutter by categorizing e-mails so that I can easily move them into folders.
Just to be clear: You might ask why I didn’t use Outlook rules to achieve the same results. The total amount of space available for rules on each folder is 32KB (see: http://support.microsoft.com/kb/147298/). One rule consumes about 600 bytes, which means that you can set up about 40-50 rules per Inbox, hardly enough to create all of the rules required to manage the thousand e-mails you get every week! I hit the 32KB limit a long time ago and that is what prompted me to write this script in the first place.
This limit has been increased to 256KB in Exchange 2007 (see: http://technet.microsoft.com/en-us/library/bb125040(EXCHG.80).aspx), but the flexibility you can achieve by using scripting to categorize your e-mail is still worth using this macro.

Here is how it works:
  1. Create a Category in Outlook for each folder you use to save your e-mail. For example: Clients, Business, Personal, Quotes, Syndeo, Support. Note: There is a special “XXX” category for e-mails that are not sorted, but can be deleted.
  2. Assign each of your Contacts to a Category you created in Step 1. Above.
  3. Run the macro.
  4. This is still a manual process: Sort the Inbox by Category and then drag all the e-mails for each Category into the appropriate folder (Maybe in a future version I will automate this).
  5. There will be some uncategorized e-mails left over after you have completed the above process. You can either manually move them into folders or you can create a new Contact entry for the Sender of the uncategorized e-mail and re-run the macro. The easiest way to create a new Contact: Just drag the e-mail to your Contacts folder.
How to install (Outlook 2003 or 2007, not tested on previous versions):
  1. Open Outlook
  2. Select Tools->Macro->Macros…
  3. Enter a new macro name: movemail and click on the Create Button
  4. Copy and paste lines below into the Macro Editor and Save it.
==========MACRO============
'Outlook Inbox Categorization Macro
'Author: Peter Schwarz, Syndeo Technologies

'Created: Sometime in the past

'Last modified: 02/17/08

Sub movemail()

On Error Resume Next

Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder

Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem

Set objNS = Application.GetNamespace("MAPI")

Set objInbox = objNS.GetDefaultFolder(olFolderInbox)

NumItems = objInbox.Items.Count

Set EmailItems = objInbox.Items

Set objContacts = objNS.GetDefaultFolder(olFolderContacts)

strWhere = "[Email1Address] <> vbNullString "

Set colItems = objContacts.Items.Restrict(strWhere)

NumContacts = colItems.Count

'Assume this is a mail folder


For I = 1 To NumItems

'Loop through Inbox

Set CurItem = EmailItems(I)

FromEmail = LCase(CurItem.SenderEmailAddress)

If Len(FromEmail) > 0 Then

ToEmail = LCase(CurItem.To)

EmailCat = ""

FromEmailDomain = Right(FromEmail, Len(FromEmail) - InStr(1, FromEmail, "@"))

'Some hardcoded categorizations

If ToEmail = "alerts" Then

EmailCat = "XXX"

ElseIf ToEmail = "reports" Then

EmailCat = "Reports"

ElseIf ToEmail = "backups" Or ToEmail = "backup" Then

EmailCat = "Backup"

ElseIf Left(FromEmailDomain, 13) = "/o=syndeotech" Then

EmailCat = "SYN"

ElseIf FromEmail = "noreply-support@syndeotech.com" Then

EmailCat = "Support"

Else

'Loop through Contacts and Categorize

For J = 1 To NumContacts

If TypeName(colItems(J)) = "ContactItem" Then

If FromEmail = LCase(colItems(J).Email1Address) Or FromEmail = LCase(colItems(J).Email2Address) Or FromEmail = LCase(colItems(J).Email3Address) Then

EmailCat = colItems(J).Categories

End If

End If

Next

End If

CurItem.Categories = EmailCat

CurItem.Save

End If

Next

Set objItem = Nothing

Set objFolder = Nothing

Set objInbox = Nothing

Set objNS = Nothing

End Sub

==========MACRO============