Find and replace within a selection

J

jp

I am reformatting text pasted over from another application. It has line
breaks, well technically "^p" paragraph marks, at the end of each line of
text, and also has two at the end of each paragraph. I am trying to remove
line breaks but not the paragraphing.

In my old copy of Word 2003, I used to do this by selecting the paragraph,
then using find and replace on the paragraph marks, then saying "no" when
given the option of searching the rest of the document. Maybe not the most
elegant solution, but it worked.

I just upgraded to Word 2007, and now it doesn't let me do that anymore.
Instead, it automatically finds and replaces ALL the paragraph marks in the
whole document, instead of just the selected paragraph. There is no more
option to search just within the selected text. Is there any way to change
that? If not, is there a workaround?
 
G

grammatim

This should work in either version (but it seems unlikely that 2007
won't let you Replace within a selection).

A three-step procedure. First, Find ^p^p and Replace with, say, ^l
(ell), which is manual line break

Then Find ^p and Replace with Space or nothing (depending on what's
already there)

Then Find ^l and Replace with ^p.
 
S

Suzanne S. Barnhill

I usually do it the other way around, replacing ^p with ^l, then replacing
^l^l with ^p. This preserves the paragraphs and the line breaks (for
purposes for which this is needed). When the line breaks aren't needed,
another replace to get rid of the line breaks or replace with a space will
do the trick.

Note, however, that in cases where every line ends in a paragraph break and
there is an empty paragraph between true paragraphs, AutoFormat will often
do the job nicely. See http://word.mvps.org/FAQs/Formatting/CleanWebText.htm
 
T

Tony Jollans

A one-step process is easier ...

With any selection ...

Find: ^13([!^13])

Replace: \1 (space, backslash, one)

Check "Use wildcards" and hit Replace All
 

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