R
Rita King
Hi
Doug Robbins provided me with the following code to apply a style (Strong)
to all capitalised text. It works a treat. (Thanks to Doug).
Sub BoldText()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2,}", MatchWildcards:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Selection.Range.Style = "Strong"
Loop
End With
End Sub
I now realise that some of the text that is to have the style applied has
words like
I DIRECT
I GIVE DEVISE AND BEQUEATH
the above macro works wonderfully but it does not apply the style to the
word "I".
Is it possible to refine this code further to include the word " I " when
followed by a word in capitals.
Sorry if I should have added this post to the end of my previous one but I
don't know whether posts that are weeks old ever get re-read.
Many thanks
Doug Robbins provided me with the following code to apply a style (Strong)
to all capitalised text. It works a treat. (Thanks to Doug).
Sub BoldText()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]{2,}", MatchWildcards:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Selection.Range.Style = "Strong"
Loop
End With
End Sub
I now realise that some of the text that is to have the style applied has
words like
I DIRECT
I GIVE DEVISE AND BEQUEATH
the above macro works wonderfully but it does not apply the style to the
word "I".
Is it possible to refine this code further to include the word " I " when
followed by a word in capitals.
Sorry if I should have added this post to the end of my previous one but I
don't know whether posts that are weeks old ever get re-read.
Many thanks