In the macro code, if you change your building block names to match the tags in the document, the building block names go in the array.
If you want to use a table to replace the tags, then setup a two column table
with no header row, the tags to find in column 1 and the formatted texts in column 2. Use manual formatting as styles may not be correctly reflected in the documents. You can then use the following macro as a custom process with the batch tool I linked to earlier:
Code:
Option Explicit
Function TableReplace(oDoc As Document) As Boolean
On Error GoTo err_Handler
Dim oChanges As Document
Dim oTable As Table
Dim oRng As Range
Dim rFindText As Range, rReplacement As Range
Dim i As Long
Dim sFname As String
Dim sAsk As String
sFname = "C:\Path\Changes.docx" 'Change as appropriate
Set oChanges = Documents.Open(Filename:=sFname, Visible:=False)
Set oTable = oChanges.Tables(1)
For i = 1 To oTable.Rows.Count
Set oRng = oDoc.Range
Set rFindText = oTable.Cell(i, 1).Range
rFindText.End = rFindText.End - 1
Set rReplacement = oTable.Cell(i, 2).Range
rReplacement.End = rReplacement.End - 1
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(FindText:=rFindText, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
Forward:=True, _
Wrap:=wdFindStop) = True
oRng.Select
oRng.FormattedText = rReplacement.FormattedText
oRng.Collapse wdCollapseEnd
Loop
End With
Next i
oChanges.Close wdDoNotSaveChanges
TableReplace = True
lbl_Exit:
Exit Function
err_Handler:
TableReplace = False
Resume lbl_Exit
End Function