Finding all paragraphs with quotes

J

jezzica85

Hi everybody,
I've been fighting with Find and Replace for a while now, and I can't figure
this out--can anyone please tell me how to find every paragraph that has an
opening quotation mark anywhere in it? It doesn't show up here unfortunately,
but I'm looking for the curly opening quotes--they're ascii code 0147, if
that helps.

Thank you!
Jezzica85
 
J

jezzica85

Thanks for the reply Herb, but I'm not just looking for the quotes per se. I
guess I wasn't clear, sorry about that. What I'd like to do is be able to
select every paragraph that contains an opening curly quote, not just the
quotes themselves.

Thanks,
Jezzica85
 
D

DeanH

Have you tried:
\"(*)\"
with wildcards on.


jezzica85 said:
Thanks for the reply Herb, but I'm not just looking for the quotes per se. I
guess I wasn't clear, sorry about that. What I'd like to do is be able to
select every paragraph that contains an opening curly quote, not just the
quotes themselves.

Thanks,
Jezzica85
 
G

Graham Mayor

Search for
^0147*^13
with the wildcard option set.

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

jezzica85

Thanks Herb,
So far that comes the closest to what I'm looking for (thank you to Dean
also!), but it doesn't select the entire paragraph if the entire paragraph
isn't surrounded by quotes. It selects the first quote all the way to the end
of the paragraph right now, but doesn't select the rest of the paragraph if
the paragraph doesn't start with a quote.

To be clear, if a paragraph is like:
"blah" text "blah"
or
"blah" text

it selects the whole paragraph fine, but if the paragraph is like:

text "blah"
or
text "blah" text

it misses the beginning of those last two cases.

Thanks for your help so far,
Jezzica85

I tried putting a tab character with a star before what you put down, but
that selects everything.
 
G

Graham Mayor

We are now in macro territory. What do you want to do with the paragraph
when you have found it?

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

jezzica85

Oh no, macros... *shudder*

Basically, all I want is to select the paragraph so I can copy it. I'm using
these paragraphs as input for a program. They don't need to be changed in any
way; I just need them as is.

Thanks,
Jezzica85
 
G

Graham Mayor

The following macro http://www.gmayor.com/installing_macro.htm will select
the next paragraph from the cursor position that contains the quote
character. Add it to a toolbar button or keyboard shortcut. The macro exits
the loop when the character is found.

Sub FindQuotes()
Dim strFind As String
Dim aText As String
Dim aEntry As AutoCorrectEntry

strFind = "^0147"

With Selection.Find
.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True

Do While .Execute(findText:=strFind, _
Wrap:=wdFindContinue, Forward:=True, _
MatchWildcards:=False) = True
aText = Selection
With Selection
.MoveUp Unit:=wdParagraph
.ExtendMode = True
.MoveDown Unit:=wdParagraph
End With
Exit Sub
Loop

End With
End Sub
 
G

Graham Mayor

Plan B - If you want to page through the document, by re-clicking the
toolbar button, you will need an extra line placed as shown below

strFind = "^0147"
Selection.EndKey Unit:=wdLine 'add this line
With Selection.Find

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
H

Herb Tyson [MVP]

Hi, Jezzica85,

Looks like you might not need a macro after all. :)

It took some experimenting to find a pattern that does what you want, but,
with Use Wildcards enabled, the following search pattern appears to select
the next paragraph that contains an opening smart quote:

[!^13]@^0147*^13


What this does... [!^13] means "anything that isn't a paragraph mark". !
means "not".

@ means "any number of the preceding character".

* means any string of characters.

So... this searches for any number of non-paragraph characters, followed by
an opening smart quote, followed by a string of any length, followed by a
paragraph mark.

So... this should match the first characters of the paragraph, up to the
smart quote, and from there to the end of the paragraph.

--
Herb Tyson MS MVP
Author of the Word 2007 Bible
Blog: http://word2007bible.herbtyson.com
Web: http://www.herbtyson.com
 

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