Store.Categories Property (Outlook)

Returns a Categories collection that represents all of the categories that are defined for the Store. Read-only.

Version Added: Outlook 2010

expression .Categories

expression A variable that represents a Store object.

This property is similar to the Categories property of the NameSpace object, except that the Store.Categories property applies to a session profile that specifies one or more accounts and Store.Categories specifies the categories for the store that an account is associated with, whereas NameSpace.Categories applies to a session profile that defines only one account and the NameSpace.Categories property specifies the Master Category List for that session.

For certain secondary delivery stores such as an IMAP store, the Categories property returns the Categories collection for the primary store. IMAP stores do not actually support a separate categories collection.

The following code sample in Microsoft Visual Basic for Applications (VBA) displays the name of each Category object that is contained in the Categories collection associated with each Store object in the Stores collection for the session.

Sub EnumerateCategoriesForStores() 
 Dim oStores As Outlook.Stores 
 Dim oStore As Outlook.Store 
 Dim oCategories As Outlook.Categories 
 Dim oCategory As Outlook.Category 
 Set oStores = Application.Session.Stores 
 For Each oStore In oStores 
 Debug.Print oStore.DisplayName 
 Debug.Print "--------------Categories-----------------" 
 Set oCategories = oStore.Categories 
 For Each oCategory In oCategories 
 Debug.Print Chr(9) & oCategory.Name 
 Debug.Print "" 
End Sub