Insert Word Building Blocks from a Drop-Down Selection
Question details
Insert a different Word building block based on the option selected in a drop-down content control.

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

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.

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.




