Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
ruan99 ruan99 is offline
external usenet poster
 
Posts: 1
Default how can i underline only 5 letter words?

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
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default how can i underline only 5 letter words?

Press Ctrl+H to display the Find & Replace dialog box. Click the More button
(if necessary) to see all options. Check the "Use wildcards" option. Specify
the following:

"Find what": ?????

"Replace with": (leave blank; choose Underline formatting in Format, Font)

Then press Replace All.

--
Stefan Blom
Microsoft Word MVP



"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



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default how can i underline only 5 letter words?

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


--
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, originally posted via msnews.microsoft.com

"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



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default how can i underline only 5 letter words?

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



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default how can i underline only 5 letter words?

Is a macro really necessary when the simple Find operation Stefan proposed
should do the job?

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

"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







  #6   Report Post  
Posted to microsoft.public.word.docmanagement
grammatim[_2_] grammatim[_2_] is offline
external usenet poster
 
Posts: 2,751
Default how can i underline only 5 letter words?

Thank you.

On Mar 30, 9:21*am, "Suzanne S. Barnhill" wrote:
Is a macro really necessary when the simple Find operation Stefan proposed
should do the job?

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

"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 sitehttp://gregmaxey.mvps.org
Word MVP web sitehttp://word.mvps.org-

  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default how can i underline only 5 letter words?

I hadn't previously tested, but I just now did, and the Replace operation
does find a five-letter word at the beginning of the document and at the end
of a sentence, as well.

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

"grammatim" wrote in message
...
Thank you.

On Mar 30, 9:21 am, "Suzanne S. Barnhill" wrote:
Is a macro really necessary when the simple Find operation Stefan proposed
should do the job?

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

"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 sitehttp://gregmaxey.mvps.org
Word MVP web sitehttp://word.mvps.org-


  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default how can i underline only 5 letter words?

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



  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default how can i underline only 5 letter words?

Stefan,

Sorry about the mispelling of your name down the thread.


Stefan Blom wrote:
Press Ctrl+H to display the Find & Replace dialog box. Click the More
button (if necessary) to see all options. Check the "Use wildcards"
option. Specify the following:

"Find what": ?????

"Replace with": (leave blank; choose Underline formatting in Format,
Font)
Then press Replace All.


"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



  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default how can i underline only 5 letter words?

Agreed that "five characters" may not be the same as "five letters."

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

"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







  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default how can i underline only 5 letter words?

Really necessary? No. However, once a macro is prepared then it is there
for reuse whenever the need arises again. That is one advantages of a
macro. Additionally the macro could easily be enhances to make it very
easy to perform other similiar tasks like finding two letter words or 10
letter words. You could even adapt it adapt it to find one, two, three,
and four letter words all in one swoop. I believe that Doug posted the
macro with the intent to be helpful.

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



  #12   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default how can i underline only 5 letter words?

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



  #13   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default how can i underline only 5 letter words?

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





  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Gordon Bentley-Mix[_2_] Gordon Bentley-Mix[_2_] is offline
external usenet poster
 
Posts: 154
Default how can i underline only 5 letter words?

Posting while distracted... I think you can get a ticket for that in NZ.
Although txting while driving is still perfectly legal. g
--
Cheers!

Gordon Bentley-Mix
Word MVP

Please post all follow-ups to the newsgroup.

Read the original version of this post in the Office Discussion Groups - no
membership required!

"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





  #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





  #16   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default how can i underline only 5 letter words?

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.


Good point.

--
Stefan Blom
Microsoft Word MVP



"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





  #17   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default how can i underline only 5 letter words?

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

Sorry about the mispelling of your name down the thread.



Well, anyone can make a mistake. The strangest so far is a poster who called
me "Ms Blom." :-)

--
Stefan Blom
Microsoft Word MVP





Stefan Blom wrote:
Press Ctrl+H to display the Find & Replace dialog box. Click the More
button (if necessary) to see all options. Check the "Use wildcards"
option. Specify the following:

"Find what": ?????

"Replace with": (leave blank; choose Underline formatting in Format,
Font)
Then press Replace All.


"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






Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Way to underline last five words of every sentence? e125 Page Layout 1 June 13th 08 12:41 AM
Is there an easy way to ONLY underline words and not the spaces? Frank Roman Microsoft Word Help 2 April 26th 06 12:23 AM
Words obscured by underline Nadiah Page Layout 0 August 3rd 05 08:56 PM
Underline one letter in a word. Geoffrey Hardwick Microsoft Word Help 3 April 19th 05 11:19 AM
Can you add a bar over words (the opposite of underline)? Michael H Microsoft Word Help 1 February 8th 05 02:37 PM


All times are GMT +1. The time now is 06:09 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"