Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Aug 2002
    London, Gtr London, England
    Thanked 0 Times in 0 Posts

    Multiple item categories & VBA (Outlook 2002 (10.6515.6735) SP3)

    Am considering using VBA to cycle through all Items in a folder and extract values of categories which have been set for the individual items. The VBA help says the property is saved as a string value. Outlook seems to use a comma "," to separate mutiple categories in that string value. So presumably if I want to get the value of each individual category where an item has multiple categories set I need parse the string, and split out the text between the commas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Multiple item categories & VBA (Outlook 2002 (10.6515.6735) SP3)

    You can use the Split function
    Dim objItem As Object
    Dim arrCategories() As String
    Dim i As Integer

    ' Set Outlook item
    Set objItem = ...
    ' Split Categories property
    arrCategories = Split(objItem.Categories, ",")
    ' Loop through parts
    For i = LBound(arrCategories) To UBound(arrCategories)
    ' Do something
    Debug.Print arrCategories(i)
    Next i
    ' Clean up
    Erase arrCategories
    Replace the Debug.Print line with something useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts