Class Category (Word VBA)

The class Category represents an individual category of a building block type.


To use a Category class variable it first needs to be instantiated, for example

Dim ctg as Category
Set ctg = CustomizationContext.BuildingBlockEntries(1).Category

The following procedures can be used to set variables of type Category: BuildingBlockType.Categories, BuildingBlock.Category and Categories.Item

For Each

Here is an example of processing the Category items in a collection.

Dim ctg As Category
For Each ctg In CustomizationContext.BuildingBlockEntries.Categories
Next ctg


Returns the number of items in the Categories collection.

Dim lngCount As Long
lngCount = CustomizationContext.BuildingBlockTypes(1).Categories.Count


Returns a Category object that represents the specified item in the collection.

Syntax : expression.Item (Index)

Index: Specifies a String or Integer that represents the name or ordinal position of the object in the collection.

Dim ctg As Category
Set ctg = CustomizationContext.BuildingBlockTypes(1).Categories(Index:=1)


Returns an object that represents the parent object of the specified Categories collection.

Dim objParent As Object
Set objParent = CustomizationContext.BuildingBlockTypes(1).Categories.Parent


Returns a BuildingBlocks collection that represents the building blocks for a category.

Dim bbsBuildingBlocks As BuildingBlocks
Set bbsBuildingBlocks = CustomizationContext.BuildingBlockEntries(1).Category.BuildingBlocks


Returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = CustomizationContext.BuildingBlockEntries(1).Category.Index


Returns the name of the specified object.

Dim strName As String
strName = CustomizationContext.BuildingBlockEntries(1).Category.Name


Returns an object that represents the parent object of the specified Category object.

Dim objParent As Object
Set objParent = CustomizationContext.BuildingBlockEntries(1).Category.Parent


Returns a BuildingBlockType object that represents the type of building block for a building block category.

Dim bbtType As BuildingBlockType
Set bbtType = CustomizationContext.BuildingBlockEntries(1).Category.Type