View Single Post
 
Old 01-01-2020, 04:17 PM
jeffreybrown jeffreybrown is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Hi Pierre,

Maybe

Code:
Sub AtTheDateOf()
    Dim oRng As Range
    Dim arrParts() As String
    With Selection
        .HomeKey Unit:=wdStory
        .Find.Execute FindText:="at the date of [0-9]{2,}.[0-9]{2,}.[0-9]{4,}"
        .Expand wdParagraph
        Set oRng = .Range
    End With
  With oRng
    arrParts() = Split(.Text, " at the date")
    .Text = arrParts(0)
    .Font.Bold = True
    .Font.Italic = True
    .Collapse wdCollapseEnd
    .Text = arrParts(1)
    .Font.Bold = False
    .Font.Italic = False
  End With
lbl_Exit:
  Exit Sub
End Sub
Reply With Quote