The macro doesn't know what Email is. You need to tell it where to look.
Public Sub autocategories() Dim olItem As Object For Each olItem In Application.ActiveExplorer.Selection If InStr(1, olItem.Subject, "[CAT1]", vbTextCompare) > 0 Then olItem.Categories = "CAT1" ElseIf InStr(1, olItem.Subject, "[CAT2]", vbTextCompare) > 0 Then olItem.Categories = "CAT2" ElseIf InStr(1, olItem.Subject, "[CAT3]", vbTextCompare) > 0 Then olItem.Categories = "CAT3" End If olItem.Save Next olItem Set olItem = Nothing End Sub




Reply With Quote