|VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
In this sample a category will be assigned to a task item as soon as it is marked completed.
Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim Ns As Outlook.NameSpace
Set Ns = Application.GetNamespace("MAPI")
Set Items = Ns.GetDefaultFolder(olFolderTasks).Items
Private Sub Items_ItemChange(ByVal Item As Object)
On Error Resume Next
Dim Task As Outlook.TaskItem
Const CategoryName As String = "(Complete)"
If TypeOf Item Is Outlook.TaskItem Then
Set Task = Item
If Task.Status = olTaskComplete Then
If LCase$(Task.Categories) <> LCase$(CategoryName) Then
Task.Categories = CategoryName