Gmail-type Labels in Outlook 2003
Gmail-type labels are very useful for organising and categorising messages. This is important for search, especially if your network admin doesn't allow you to install nifty search plugins like Xobni or Lookout.
Background: Why is this relevant? Because too many people are in the habit of using folders to organise their email in Outlook. This looks like a good idea on the surface, but somewhere down the road it becomes apparent that Outlook's default search tool only lets you search in one folder. Sure, you can do an Advanced Find and select multiple folders, but then you will realise that Outlook can only search 1 data file at a time. E.g. either messages on your main "Inbox" server, or messages in your archive (.pst) folders.... not both together! By doing away with folder organisation, dumping all messages into a single "archive" folder and applying labels, searching your mail will be a less cumbersome process.
This tutorial will show you how to make gmail-type labels in Outlook and use a one-click tool button to apply said label. This is accomplished using macros, so make sure you have enabled macros in outlook.
Our "labels" are going to be Outlook's Categories. To see Categories, right-click on any message and select Categories. You'll see a list of available Categories such as Business, Personal, etc. You can either use these, leave them be, or get rid of them. I chose to delete all default categories and start fresh. Next, add all the labels you wish to use as new categories using the Master Category List. The names of your folders might be a good place to start. In the example below, I have created two labels: OMess and Reference.
You'll notice you can now right click on any message, select Categories and put a check in one (or more) of the boxes. Apply the appropriate categories to your messages (you can select multiple) and, once done, get rid of all your folders and put your messages in one general folder.
You can now create search folders to quickly pull up those messages. They will work the same way as the old Folder system and will eilminate the need to drag each message into its proper folder. As mentioned before, you will also gain search functionality. To create a search folder, go to File > New > Search Folder. Go to the bottom and select Create a custom Search Folder. You'll then want to name it (choose a label name), click Criteria, tab to More Choices and click the Categories button. Then select the category/label you desire, and OK all the windows (see "Reference" example below). You should now have a new Search Folder that pulls up your labelled messages.....just like a folder.
You're already better off now than when we started.
To make things even better, consider adding buttons that will label a message with the click of a mouse. The macro code is below... see my Archive It post to turn it into one (or more) buttons.
Note that Subs MarkA and MarkB just call the MarkWithCategory function. You can make as many of these as you like (one for each label) and just make sure you replace "A" and "B" with 'label_1' and 'label_2', respectively.
The end result: buttons in your toolbar that automatically label your messages!
Disclaimer: I didn't write this macro; I found it on here.
Background: Why is this relevant? Because too many people are in the habit of using folders to organise their email in Outlook. This looks like a good idea on the surface, but somewhere down the road it becomes apparent that Outlook's default search tool only lets you search in one folder. Sure, you can do an Advanced Find and select multiple folders, but then you will realise that Outlook can only search 1 data file at a time. E.g. either messages on your main "Inbox" server, or messages in your archive (.pst) folders.... not both together! By doing away with folder organisation, dumping all messages into a single "archive" folder and applying labels, searching your mail will be a less cumbersome process.
This tutorial will show you how to make gmail-type labels in Outlook and use a one-click tool button to apply said label. This is accomplished using macros, so make sure you have enabled macros in outlook.
Our "labels" are going to be Outlook's Categories. To see Categories, right-click on any message and select Categories. You'll see a list of available Categories such as Business, Personal, etc. You can either use these, leave them be, or get rid of them. I chose to delete all default categories and start fresh. Next, add all the labels you wish to use as new categories using the Master Category List. The names of your folders might be a good place to start. In the example below, I have created two labels: OMess and Reference.
You'll notice you can now right click on any message, select Categories and put a check in one (or more) of the boxes. Apply the appropriate categories to your messages (you can select multiple) and, once done, get rid of all your folders and put your messages in one general folder.
You can now create search folders to quickly pull up those messages. They will work the same way as the old Folder system and will eilminate the need to drag each message into its proper folder. As mentioned before, you will also gain search functionality. To create a search folder, go to File > New > Search Folder. Go to the bottom and select Create a custom Search Folder. You'll then want to name it (choose a label name), click Criteria, tab to More Choices and click the Categories button. Then select the category/label you desire, and OK all the windows (see "Reference" example below). You should now have a new Search Folder that pulls up your labelled messages.....just like a folder.
You're already better off now than when we started.
To make things even better, consider adding buttons that will label a message with the click of a mouse. The macro code is below... see my Archive It post to turn it into one (or more) buttons.
Note that Subs MarkA and MarkB just call the MarkWithCategory function. You can make as many of these as you like (one for each label) and just make sure you replace "A" and "B" with 'label_1' and 'label_2', respectively.
' usage examples setting category A or B
Sub MarkA()
Call MarkWithCategory("A")
End Sub
Sub MarkB()
Call MarkWithCategory("B")
End Sub
' This is the main procedure
Sub MarkWithCategory(strCat As String)
Dim objItem As Object
Set objItem = GetCurrentItem()
If Not objItem Is Nothing Then
objItem.Categories = objItem.Categories & "," & strCat
objItem.Save
End If
Set objItem = Nothing
End Sub
' Returns the currently selected or open item
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
Sub MarkA()
Call MarkWithCategory("A")
End Sub
Sub MarkB()
Call MarkWithCategory("B")
End Sub
' This is the main procedure
Sub MarkWithCategory(strCat As String)
Dim objItem As Object
Set objItem = GetCurrentItem()
If Not objItem Is Nothing Then
objItem.Categories = objItem.Categories & "," & strCat
objItem.Save
End If
Set objItem = Nothing
End Sub
' Returns the currently selected or open item
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
The end result: buttons in your toolbar that automatically label your messages!
Disclaimer: I didn't write this macro; I found it on here.