Again Graham and I are showing you several ways of doing things with VBA. There is nothing wrong with Grahams "implicit" method and I often in not generally use the same "BuildingBlockEntries().Insert method as he did. You will have no problem with that method as long as you ensure you Building Blocks names are unique.
However, suppose you or one of your users has a Building Block named "TestBB" in the Normal template AutoText gallery "General" category, one named "TestBB" in the same gallery in a "Test Category" category and one named "TestBB" in the QuickParts gallery "General" category.
Which one will be inserted in the bookmark? Word has to decide and with Word 2010 it will choose the one in the AutoText gallery, General category. However in Word 2007 the choice is different.
Here is a version of my earlier code that lets you decide if you want to pass just a BB name and let Word sort it out or explicitly pass the gallery, category and BB name.
Note: once you have the list of gallery constants you can delete the For lngIndex = 1 to 35 ... Next loop.
Sub Demo()
'General (let Word sort it out)
fcnFillBMwithBB "bmTest", "Normal.dotm", "TestBB"
'Explicit
fcnFillBMwithBB "bmTest", "Normal.dotm", "TestBB", 1, "Test Category"
End Sub
Function fcnFillBMwithBB(strBM As String, strTemplate As String, strBBName As String, _
Optional lngGal As Long = 0, Optional strCat As String = "General")
Dim oTmp As Template
Dim lngIndex As Long
Dim oRng As Word.Range
Templates.LoadBuildingBlocks
For Each oTmp In Templates
If oTmp.Name = strTemplate Then Exit For
Next oTmp
'You can use this For ... Next loop to determine the gallery type constant for your BBs.
For lngIndex = 1 To 35
Debug.Print oTmp.BuildingBlockTypes(lngIndex).Name & " "; lngIndex
Next
Set oRng = ActiveDocument.Bookmarks(strBM).Range
If lngGal > 0 Then
Set oRng = oTmp.BuildingBlockTypes(lngGal). _
Categories(strCat).BuildingBlocks(strBBName).Insert(oRng, True)
Else
Set oRng = Application.Templates(strTemplate). _
BuildingBlockEntries(strBBName).Insert(oRng, True)
End If
ActiveDocument.Bookmarks.Add strBM, oRng
lbl_Exit:
Set oTmp = Nothing: Set oRng = Nothing
End Function