Helen269
02-27-2019, 03:58 AM
I have situations in a Word doc where I have this:
Name
[unclear]
I have a macro that looks for paragraph marks, the backwards capital P, and changes the '[u' to '[U'. The only problem is it then becomes:
Name
[Unclear]
How do I stop the bold formatting on the '[U' bit?
This is the VBA:
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p[u"
.Replacement.Text = "^p[U"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Many thanks,
Helen
Name
[unclear]
I have a macro that looks for paragraph marks, the backwards capital P, and changes the '[u' to '[U'. The only problem is it then becomes:
Name
[Unclear]
How do I stop the bold formatting on the '[U' bit?
This is the VBA:
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p[u"
.Replacement.Text = "^p[U"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Many thanks,
Helen