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:
- 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.
- Assign each of your Contacts to a Category you created in Step 1. Above.
- Run the macro.
- 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).
- 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.
- Open Outlook
- Select Tools->Macro->Macros…
- Enter a new macro name: movemail and click on the Create Button
- Copy and paste lines below into the Macro Editor and Save it.
'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============
No comments:
Post a Comment