how do I remove hard returns after every line?

T

Thom D

Text downloaded from Internet with hard return after everyline. How do I
remove them?
Thanks,
 
O

Opinicus

Thom D said:
Text downloaded from Internet with hard return after everyline. How do I
remove them?

Define a block of text containing the lines that you want to remove the hard
returns from. Type ctrl-H (control-key H). In the "Find what" window enter
"^p" (without the quotes). In the "Replace with" window enter " ". (Single
space, without the quotes.) Click on "Replace all". When asked if you want
to search the remainder of the document, click on "No".

"^p" (without the quotes) is the stand-in code for hard return. You can
define the whole document but it you do, you'll lose any paragraph
separations, which could become messy.

Here's a macro that automates the process after defining a block of text:

Sub ZapControlP()
'
' ZapControlP Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

HTH.
 

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