This topic has not yet been rated - Rate this topic

BuildingBlocks.Add Method

Office 2007
Creates a new building block and returns a BuildingBlock object.

Syntax

expression.Add(Name, Range, Description, InsertOptions)

expression   An expression that returns a BuildingBlocks object.

Parameters

NameRequired/OptionalData TypeDescription
NameRequiredStringSpecifies the name of the building block entry. Corresponds to the Name property of the BuildingBlock object.
RangeRequiredRangeSpecifies the value of the buildling block entry. Corresponds to the Value property of the BuildingBlock object.
DescriptionOptionalVariantSpecifies the description of the buildling block entry. Corresponds to the Description property of the BuildingBlock object.
InsertOptionsOptionalWdDocPartInsertOptionsSpecifies whether the building block entry is inserted as a page, a paragraph, or inline. If omitted, the default value is wdInsertContent. Corresponds to the InsertOptions property for the BuildingBlock object.

Return Value
BuildingBlock

Example

The following example adds a new building block auto text entry to the first template in the collection of templates.

Visual Basic for Applications
Dim objTemplate As Template

Set objTemplate = Templates(1)

objTemplate.BuildingBlockTypes(wdTypeAutoText) _
    .Categories("General").BuildingBlocks _
    .Add Name:="New Building Block", _
    Range:=Selection.Range



Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ