View Single Post
 
Old 02-08-2017, 04:29 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As Word.Field
Dim oRng As Range
For Each oFld In ActiveDocument.Fields
  Set oRng = oFld.Code.Words.First.Previous.Previous
  oRng.MoveStart wdWord, -1
  If oRng.Text = "Section" Then
    oFld.Code.Text = oFld.Code.Text & " \* Charformat"
    oFld.Code.Characters(2).Font.Bold = True
    oFld.Update
  End If
Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote