Export (0) Print
Expand All

BuildingBlockTypes Collection

Office 2007
Represents a collection of BuildingBlockType objects.

Version Information
 Version Added:  Word 2007

Remarks

Building block types are represented by WdBuildingBlockTypes constants. Use the Item method to access a specific type in the BuildingBlockTypes collection.

To loop through the different building block types, use a For loop with the Count property. The following example loops through the building block types and prints the name in the Immediate Window. (This example assumes that the Immediate Window is visible.)

Visual Basic for Applications
Dim objTemplate As Template
Dim intCount As Integer
Dim objBBT As BuildingBlockType

Set objTemplate = Templates(1)

For intCount = 1 To objTemplate.BuildingBlockTypes.Count
    Set objBBT = objTemplate.BuildingBlockTypes(intCount)
    Debug.Print objBBT.Name
Next

For more information about building blocks, see Working with Building Blocks.




Community Additions

ADD
Show:
© 2014 Microsoft