AppointmentItem.Categories Property

Outlook Developer Reference

Returns or sets a String representing the categories assigned to the Outlook item. Read/write.

Syntax

expression.Categories

expression   A variable that represents an AppointmentItem object.

Remarks

Categories is a comma-delimited string of category names that have been assigned to an Outlook item. To convert the string of category names to an array of category names, use the Microsoft Visual Basic function Split.

Example

The following Microsoft Visual Basic/Visual Basic for Applications (VBA) example creates a new appointment, displays the appointment on the screen, and opens the Show Categories dialog box. Finally, it displays the categories that the user assigned using AppointmentItem.ShowCategoriesDialog. Replace 'Dan Wilson' with a valid recipient name before running the example.

Visual Basic for Applications
  Sub Appointment()
    'Creates an appointment to access ShowCategoriesDialog
    Dim olApptItem As Outlook.AppointmentItem
    
    'Creates appointment item
    Set olApptItem = Application.CreateItem(olAppointmentItem)
    olApptItem.Body = "Please meet with me regarding these sales figures."
    olApptItem.Recipients.Add ("Dan Wilson")
    olApptItem.Subject = "Sales Reports"
    'Display the appointment
    olApptItem.Display
    'Display the Show Categories dialog box
    olApptItem.ShowCategoriesDialog
    MsgBox olApptItem.Categories
End Sub

See Also