Change Font Italic or normal from one point
Many thanks Jeffrey.
I tested today but the macro is blocking under:
.Text = arrParts(1)
and I have to debug
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
Here the text I want to adapt each time:
MRI Brain at the date of 10.01.2020
should be written:
MRI Brain : in Italic and Bold (left side of "at the date of")
10.01.2020 : in normal caracters (right size of "at the date of")
But this Title "MRI Brain is changing and the date as well .
Nice regards and many thanks for your help
|