View Single Post
 
Old 01-12-2020, 05:29 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,431
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

You are never going to get anything to work if you are going to continue to move the goal posts!!! The text "in the date of" is not present in the sample document you sent. In addition, that document has content controls so the search string used previously just isn't going to work.

Try this:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
Dim oRngP As Range
Dim arrParts() As String
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = " né(e) le "
While .Execute
With oRng
Set oRngP = oRng.Duplicate
oRngP.Expand wdParagraph
oRngP.End = oRng.Start
With oRngP
.Font.Bold = True
.Font.Italic = True
End With
oRng.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