View Single Post
 
Old 01-01-2020, 05:06 AM
gmaxey gmaxey is offline Windows 10 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

Or an adaptation of Jeffrey's code:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
Dim arrParts() As String
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "Title and subtitle at the date of [0-9]{2,}.[0-9]{2,}.[0-9]{4,}"
    .MatchWildcards = True
    While .Execute
      With oRng
        arrParts() = Split(.Text, " at the date of")
       .Text = arrParts(0)
       .Font.Bold = True
       .Font.Italic = True
       .Collapse wdCollapseEnd
       .Text = arrParts(1)
       .Font.Bold = False
       .Font.Italic = False
       .Collapse wdCollapseEnd
      End With
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote