StartDownloadsServiceSamplesWorkshopsContact DeutschEnglish
Awarded by
Microsoft since 2005:
mvp logo
VBOffice Info
Privacy Policy
Category entered directly
Author: Michael BauerHomepage
Date: 15.12.2009Accessed: 14198

Before Outlook 2007 you could directly enter a category for any item without saving it to the master category list. Since Outlook 2007 that's not possible anymore.

With the following code you'll get this functionality back. Multiple keywords can be entered separated by a comma or semi-colon.

Copy the code to the module "ThisOutlookSession", and save the project. Then you can create a commandbar button for calling the function by a right click on any toolbar, then choose Customize, Commands, Macros, and drag the name of the function onto a toolbar. By another right-click on the newly created button you can customize its style. (Perform these steps once for the folder view, and if you want to, once for any form for which the function should be available.)

Alternatively, you could also call the function by pressing alt+f8.

Public Sub EnterKeyword()
  Dim Coll As VBA.Collection
  Dim obj As Object
  Dim s$

  Set Coll = GetCurrentItems
  If Coll.Count = 0 Then Exit Sub

  s = InputBox("Keyword:")
  s = Trim$(s)
  If Len(s) = 0 Then Exit Sub

  For Each obj In Coll
    obj.Categories = obj.Categories & "," & s
End Sub

Private Function GetCurrentItems() As VBA.Collection
  Dim Coll As VBA.Collection
  Dim Win As Object
  Dim Sel As Outlook.Selection
  Dim obj As Object
  Dim i&

  Set Coll = New VBA.Collection
  Set Win = Application.ActiveWindow

  If TypeOf Win Is Outlook.Inspector Then
    Coll.Add Win.CurrentItem
    Set Sel = Win.Selection
    If Not Sel Is Nothing Then
      For i = 1 To Sel.Count
        Coll.Add Sel(i)
    End If
  End If
  Set GetCurrentItems = Coll
End Function

ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the ... [more]


Access the master category list in the blink of an eye, share your categories in a network, get a reminder service, and ... [more]


SAM automatically sets the sender, signature, and folder for sent items, for instance based on the recipient ... [more]


OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or ... [more]