Share via


BuildingBlock.Insert Method

Word Developer Reference

Inserts the value of a building block into a document and returns a Range object that represents the contents of the building block within the document.

Syntax

expression.Insert(Where, RichText)

expression   An expression that returns a BuildingBlock object.

Parameters

Name Required/Optional Data Type Description
Where Required Range The location of where to place the contents of the building block.
RichText Optional Variant True inserts the building block as rich, formatted text. False inserts the building block as plain text.

Return Value
Range

Example
The following example inserts the first building block from the first template into the first paragraph of the active document.

Visual Basic for Applications
  Dim objTemplate As Template
Dim objBB As BuildingBlock

Set objTemplate = Templates(1) Set objBB = objTemplate.BuildingBlockEntries(1)

objBB.Insert ActiveDocument.Paragraphs(1).Range

See Also