I need to have word automatically change all words in brackets to

G

Guest

Hello,

I am wondering if there's a way for Word to automatically make all words I
type in brackets red. For instance if I type: <piano> I want word to type
it in red automatically without me having to do it manually. I type long
documents with a lot of brackets that I need to stand out.

Thanks
 
G

Greg Maxey

If you can wait until your have finished your draft, your can make the
changes with the following macro:

Sub FindAndChangeFontInBracketedText()

'Changes font to red in text contained in < >
Dim oRng As Range
Set oRng = ActiveDocument.Content

With oRng.Find
.ClearFormatting
.Text = "[/<]<*>[/>]"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
With oRng
.Font.Color = wdColorRed
.Collapse wdCollapseEnd
End With
Loop
End With
End Sub
 
G

Graham Mayor

No - you'll have to use the replace function to achieve that.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Greg Maxey

BTW,

You can also do this with the Find and Replace dialog. Edit>Replace and
click use wildcards. Type the find string I proviced (less the " ") in the
find what field and type ^& in the replace with window. Click
More>Format>Font and apply the red font attribute. Replace all/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top