Best Way to underline last five words of every sentence?

E

e125

I would like go through my long document and underline the last five words of
every sentence. What would be the best way go about this? I am working with
Word 2003.

Suggestions more than welcome.
 
D

Doug Robbins - Word MVP

Use a macro containing the following code:

Dim myrange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(Findtext:=". ", Forward:=True, MatchWildcards:=False,
Wrap:=wdFindStop) = True
Set myrange = Selection.Range
Selection.Collapse wdCollapseEnd
myrange.MoveStart Unit:=wdWord, Count:=-5
myrange.End = myrange.End - 2
myrange.Font.Underline = wdUnderlineSingle
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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