Underline text surrounded by quotes

A

Angie M.

Hello,

I have a long document that contains hundreds of phrases in quotation marks.
Now they want everything in quotation marks to be underlined. Can you
assign a range object to text in quotes (not sure how to do that) or is there
another way to approach this problem? Thanks for the help.
 
J

jille

Hi Angie,

It's best to simply do a search & replace. You will use the search string of
“*â€, and replace with nothing but change the format to underline for the
replace string only.

Two things to ensure:
-the use wildcards option is active (it's a checkbox in the S&R dialog box)
-you use the correct representation of your quotation marks...just copy and
paste them into the search string box

Once you're done just do another search and replace to take out the
quotation marks. (ie. search for “ and replace with nothing, and search for "
and replace with nothing.

One final thought...I would assume that you haven't used a single quotation
mark anywhere, yes?

Good luck,

Jille
 
G

Greg Maxey

Hi Angie,

It's best to simply do a search & replace. You will use the search string of
"*", and replace with nothing but change the format to underline for the
replace string only.

Two things to ensure:
-the use wildcards option is active (it's a checkbox in the S&R dialog box)
-you use the correct representation of your quotation marks...just copy and
paste them into the search string box

Once you're done just do another search and replace to take out the
quotation marks. (ie. search for " and replace with nothing, and search for "
and replace with nothing.

One final thought...I would assume that you haven't used a single quotation
mark anywhere, yes?

Good luck,

Jille






- Show quoted text -

I just happened to have this around:

Sub FindAndUnderlineTextInQuotes()
'Underlines text exclusive of the quotes marks
Dim oRng As Range
Set oRng = ActiveDocument.Content

With oRng.Find
.ClearFormatting
.Text = """<*>"""
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
With oRng
.MoveEnd Unit:=wdCharacter, Count:=-1
.MoveStart Unit:=wdCharacter, Count:=1
.Font.Underline = True
.Collapse wdCollapseEnd
End With
Loop
End With
End Sub
 
E

Elessvie

Greg Maxey said:
I just happened to have this around:

Sub FindAndUnderlineTextInQuotes()
'Underlines text exclusive of the quotes marks
Dim oRng As Range
Set oRng = ActiveDocument.Content

With oRng.Find
.ClearFormatting
.Text = """<*>"""
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
With oRng
.MoveEnd Unit:=wdCharacter, Count:=-1
.MoveStart Unit:=wdCharacter, Count:=1
.Font.Underline = True
.Collapse wdCollapseEnd
End With
Loop
End With
End Sub

Hello, Angie, Jillie and Greg --

Thank you for your posts. And, thanks to this great discussion group, I've
been using your macro, Greg, and it's been working great UNLESS it comes
across a series of words or phrases, each in quotes (like: "APPLE"
"PAVEMENT" and "NEW TREES"). Then, the macro underlines everything between
the quotes right before APPLES and the quotes right after TREES, including
spaces and the other quotes.

What do I have to do get the macro to underline only each individual word in
that series, not the whole list?

Thanks for any help you can offer.

-Lynne
 
J

jerem

I have a lot of stuff that I just happen to have around and most of it is
junk. Can't say that for you. I'd like to do a thorough search through your
closets.

Another very handy tool to add to my "Greg Repetoire" (don't know if I
spelled that correctly, but you get the drift).
 

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