This is a variation of Grahams macro. (Code tags not working)
Sub BoldCenterText()
With ActiveDocument
ChangeFont ActiveDocument
End With
End Sub
Function ChangeFont(wdDoc)
Dim oTable As Table
Dim oRng As Range
Dim oRow As Row
Dim strText As String
strText = InputBox("Search text?")
For Each oTable In wdDoc.Tables
For Each oRow In oTable.Rows
If InStr(1, oRow.Range, strText) > 0 Then
Set oRng = oRow.Range
oRow.ConvertToText Separator:=Chr(9)
oRng.Font.Bold = True
oRng.Font.Size = 14
oRng.ParagraphFormat.Alignment = wdAlignParagraphCenter
oRng.InsertParagraphBefore
End If
Next oRow
Next
lbl_Exit:
Set oTable = Nothing
Set oRng = Nothing
Set oRow = Nothing
Exit Function
End Function
|