StartDownloadsServiceSamplesWorkshopsContact DeutschEnglish
 
Samples
General
Outlook®
 
Awarded by
Microsoft since 2005:
mvp logo
VBOffice Info
Visitors1804121
Impressions6758148
Links
Imprint
Privacy Policy
Contact
Task: Categorize a completed task.
Author: Michael BauerHomepage
Date: 13.04.2007Accessed: 24597
  
Description

The sample shows how to categorize a task automatically as soon as it is completed.

' <DieseOutlookSitzung>
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
End Sub

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
        Task.Save
      End If
    End If
  End If
End Sub
' </DieseOutlookSitzung>
 
 

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]