View Single Post
  #15   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default how can i underline only 5 letter words?

Texting (and using mobile phones) behind the wheel is illegal here, but so
widespread that you wouldn't know it. We also have one of the highest road
death rates in the Western World! Fortunately traffic is often so light that
most only kill themselves!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Gordon Bentley-Mix wrote:
Posting while distracted... I think you can get a ticket for that in
NZ. Although txting while driving is still perfectly legal. g

"Suzanne S. Barnhill" wrote in message
...
Missed that part entirely. My quick take on your original post was
that it was a refinement to Doug's macro. As you may have gathered
from my posts in the private NG, I was a bit distracted yesterday.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"Greg Maxey" wrote in
message ...
Are you disagreeing with "Find: [! ]{3} Replace with: ^&
formatted with underline" is not a macro?


Suzanne S. Barnhill wrote:
Agreed that "five characters" may not be the same as "five
letters." "Greg Maxey"
wrote in
message ...
While wrong for the task at hand (Sorry), Find: [! ]{3} Replace
with: ^& formatted with underline" is not a macro.

It is wrong, because I copied it from an old reference I had for
finding three letter words. I wasn't disputing Stephan's
proposal. If fact I didn't even see it.

Looking at the issue a little closer ????? may not completely
fit the bill. Is "don't" a five letter word, four letter word
with an apostrophe, a four letter word, or a two letter word
connected to a three letter word with an apostrophe? Is $12.95 a
five letter word?, is a five character zip code a five letter
word or a just a number? I suppose if one is just looking for
words spelled with five letters of the alphabet then something
like: Find: [A-Za-z]{5}

may be more desirable.



Suzanne S. Barnhill wrote:
Is a macro really necessary when the simple Find operation Stefan
proposed should do the job?


"Greg Maxey" wrote
in message ...
Doug,

That misses the first word of the document if 5 characters and
the last word of a sentence if 5 characters.

This seems to work: Find: [! ]{3} Replace with: ^& formatted
with underline.


Doug Robbins - Word MVP on news.microsoft.com wrote:
Use a macro containing the following code:

Dim myRange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=" [A-z]{5} ", Forward:=True, _
MatchWildcards:=True, Wrap:=wdFindStop,
MatchCase:=False) = True Set myRange = Selection.Range
Selection.Collapse wdCollapseEnd
myRange.Start = myRange.Start + 1
myRange.End = myRange.End - 1
myRange.Font.Underline = wdUnderlineSingle
Loop
End With



"ruan99" wrote in message
...
I have an essay written but I have to underline only the 5
letter words in it. I do not want to go back and underline
them all individually, so I am wondering if there is a way to
mass underline only 5 letter words. Thank you

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org