Unwanted paragraph breaks when pasting text

P

PeterSJC

If I paste text from a web page or a .txt file into Word 2007, I would like
to retain the paragraph structure, so that a paragrah break occurs whenever
there is white space (two consecutive line breaks) between two lines of text.
Instead, Word puts a paragraph break at the end of every line. Is there an
easy way to prevent those extra paragraph breaks?
 
J

Jay Freedman

If I paste text from a web page or a .txt file into Word 2007, I would like
to retain the paragraph structure, so that a paragrah break occurs whenever
there is white space (two consecutive line breaks) between two lines of text.
Instead, Word puts a paragraph break at the end of every line. Is there an
easy way to prevent those extra paragraph breaks?

It isn't Word that inserts the paragraph breaks; they're in the clipboard that
way from the web page or other source.

To clean up afterward, use the information in
http://sbarnhill.mvps.org/WordFAQs/CleanWebText.htm.
 
P

Paul

Jay, recently I stumbled upon the idea of having word paste "text only"
(instead of formatted text) whenever I right-click and select Paste. Would
this resolve the OP's issue?

This can be done by clicking on the bottle of glue icon at the bottom of
every block of text pasted; Word can also be made to make this the default
behavior (still allowing you, if you want to have formatted text, to click
the glue icon and select that option).
--
Paul

MS Office 2003
Vista Home Basic SP1
Dell Inspiron 1501
 
J

Jay Freedman

Whether pasting text only will help depends on why the lines are breaking.
If there is an actual paragraph mark or line break at the end of each line
in the source material, text-only won't help at all. If it's because the
formatted text is bringing along indents that are set in the source, then it
will help.
 
P

PeterSJC

Paul, unfortunately, pasting "text only" does not seem to work. When I first
paste the text, it is placed into the Word document with the original
document's font and with single-spaced lines, each ending with a paragraph
mark. If I then click the clipboard icon (which is probably the equivalent of
the glue icon in the version of Word that you are using) and select "Keep
Text Only", the font changes to whatever I am using in Word, and each of
those single-line "paragraphs" now takes the settings that I am using for
paragraph spacing. In other words, "Keep Text Only" pastes the text without
its original formatting, but that text includes the paragraph breaks that
were apparently placed at the end of each line in the clipboard.

Jay, thanks for the link to the "Cleaning Up Pasted Text" article on Suzanne
Barnhill's MVPS page. The article outlines two approaches ("Using Auto
Format" and "Using Find and Replace"):

In "Using Auto Format" the article says:

"...In Word 2007, find this tab at Office Button | Word Options | Proofing:
AutoCorrect Options. No matter what other AutoFormat options you have enabled
here, when you select a block of text with a paragraph break at the end of
each full line, AutoFormat will delete all the paragraph breaks but the last."

Following those instructions, I see that all boxes are checked in the
AutoFormat tab. Most of the boxes are checked in the AutoFormat As You Type
tab are also checked, though none of those seem relevant to the the problem
at hand. So, I close the menu, go back to my text, and select a few
paragraphs. But now what? Is Barnhill saying that just selecting paragraphs
triggers Auto Formatting? Apparently not, because nothing happens. On the
other hand, I cannot find any Auto Format command, so I move on to Barnhill's
second approach.

"Using Find and Replace"

Barnhill's advice (to put ^l^l into the "Find what" box) does not work,
which doesn't surprise me, because there are no line breaks (^l) to be found.
Remember, they have all been converted to paragraph breaks. However I was
able to get what I want by modifying her approach, as follows:

FIRST PASS:
1. Press Ctrl+H to open the Replace dialog.
2. In the “Find what†box, type ^p^p (which finds the two consecutive
paragraph breaks that occur in those places where I actually want a paragraph
break).
3. In the “Replace with†box, type **EOP** (an arbitrary string not found
anywhere else in the document).
4. Click Replace All. I now have a paragraph break at the end of each true
paragraph.

SECOND PASS (the Replace dialog is still open):
1. In the “Find what†box, type ^p (which finds all of the unwanted
paragraph breaks).
2. In the “Replace with†box, type a space.
3. Click Replace All.

THIRD PASS (the Replace dialog is still open):
1. In the “Find what†box, type **EOP** (the arbitrary string I used in
Pass 1, to mark all of the paragraph breaks I want to keep).
2. In the “Replace with†box, type ^p (a paragraph break).
3. Click Replace All.
4. Click Close to close the Replace dialog box.

We are done. It seems like a lot of work to do something that should be
automatic (I can't be the only person who wants to copy text that Internet
Explorer renders as a paragraph into a similar paragraph in Word), but it was
much easier than deleting the paragraph breaks individually.

Thanks,
Peter
Using Vista Ultimate (32 bit) SP 2, Internet Explorer 8 (when browsing a
web page that doesn't like Chrome), and Office Word 2007 SP2
 
J

Jay Freedman

Hi Peter,

Two points:

- For the AutoFormat method, you skipped over this statement in the "Note"
in Suzanne's description: "In Word 2007, you will have to add an AutoFormat
button to the Quick Access Toolbar (QAT) from the "Commands Not in the
Ribbon" section of the Office Button | Word Options | Customize dialog." If
you don't want to do that, I think you'll find that the keyboard shortcut
Ctrl+Alt+K is assigned by default to the AutoFormat Now command.

- The Replace method is complicated but, as Suzanne said, "If you want to
automate any of the above steps you can record them using the macro recorder
and play them back as needed."

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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