Document Editing Problems

Insert Word Building Blocks from a Drop-Down Selection

Natalie TaylorNatalie Taylor Nov 20, 2026 869 views

Question details

Insert a different Word building block based on the option selected in a drop-down content control.

Insert Word Building Blocks from a Drop-Down Selection
Product
Microsoft Word
Device & OS
not provided
Scenario
A document offers choices such as “does” and “does not,” and the selected choice determines which building block is inserted.
Observed behavior
The selected building block should appear in a designated document location when the user leaves the drop-down control.
Before you start

In desktop Word, create building blocks named exactly “does” and “does_not” and check which template stores them. The example below uses Normal.dotm, a drop-down content control, and a bookmark as the insertion target.

Solution 1Recommended

Insert a Building Block When the User Leaves the Drop-Down

Use Word’s document content control exit event to map each choice to a building block in Normal.dotm.

This example replaces the contents of a bookmark named BlockTarget. It looks up entries in NormalTemplate; if your entries are stored elsewhere, use the corresponding template instead.

The event runs when the user leaves the drop-down, not immediately when the selection changes. Save the document as a macro-enabled Word document and enable macros only if you trust its code.

1
Set up the drop-down

On the Developer tab, insert a Drop-Down List Content Control. Open Properties, set its Tag to Choice, and add display choices exactly named does and does not.

2
Create the insertion bookmark

Click where the building block should appear, then choose Insert > Bookmark. Enter BlockTarget and select Add. Keep this bookmark outside the drop-down control.

3
Add the event code

Open Developer > Visual Basic. In the project for your document, open ThisDocument and paste the following code: Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Dim blockName As String Dim target As Range Dim inserted As Range Dim block As BuildingBlock If ContentControl.Tag <> "Choice" Then Exit Sub Select Case Trim(ContentControl.Range.Text) Case "does" blockName = "does" Case "does not" blockName = "does_not" Case Else Exit Sub End Select On Error Resume Next Set block = NormalTemplate.BuildingBlockEntries(blockName) On Error GoTo 0 If block Is Nothing Then MsgBox "Building block not found in Normal.dotm: " & blockName Exit Sub End If If Not ThisDocument.Bookmarks.Exists("BlockTarget") Then MsgBox "Bookmark BlockTarget was not found." Exit Sub End If Set target = ThisDocument.Bookmarks("BlockTarget").Range target.Text = "" Set inserted = block.Insert(Where:=target, RichText:=True) ThisDocument.Bookmarks.Add Name:="BlockTarget", Range:=inserted End Sub

4
Save and test

Use File > Save As to save a Word Macro-Enabled Document (.docm). Select does or does not in the drop-down, then click outside it and check the bookmarked location.

Insert a Building Block When the User Leaves the Drop-Down
Check the template and entry name: If Word reports that a collection member does not exist, check the exact name for extra spaces and confirm that the entry is saved in Normal.dotm. In the reported case, changing the entry’s location from Building Blocks to Normal resolved the lookup problem.
Free Microsoft Office alternative

Edit Word Documents with WPS Writer

WPS Office is a free, lightweight Office alternative with a familiar interface for opening and editing documents. It supports common Word formats for an easier move between office suites, but it does not fix Word’s building block or VBA event behavior.

Open and edit Microsoft Word DOC and DOCX filesWork on document text and layouts in WPS WriterUse familiar editing tools in a lightweight office suiteMove existing Word documents into a free Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Why does Word say the requested building block does not exist?

The entry name may differ from the code, contain an extra space, or be stored in a different template. Check the name and template in Insert > Quick Parts > Building Blocks Organizer, then make sure the code looks in that template.

Why does nothing happen when I select an option?

The ContentControlOnExit event runs when you leave the control. Click elsewhere after selecting an option, and confirm that the code is in ThisDocument and the control’s Tag is Choice.

Can I store the building blocks outside Normal.dotm?

Yes. Save the entries in the appropriate template and change the NormalTemplate reference in the code to the template that contains them. The entry names must still match the names used in the code.

Why does the code recreate the bookmark after insertion?

Replacing a bookmark’s contents can remove the bookmark. Adding BlockTarget around the inserted range lets a later selection replace that content again.