View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Opinicus Opinicus is offline
external usenet poster
 
Posts: 116
Default how do I remove hard returns after every line?

"Thom D" Thom wrote

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.

--
Bob
http://www.kanyak.com