K
kansaskannan
I want to be able to select a few lines of text, and then remove all
the line breaks (only) in that selection and replace the linebreak
with a space.
How do I do that? The following code does not work properly. I am
using Word 2003.
Thank you.
---------------------------------------------------------------
Sub SelectionRemoveHardLineBreaks()
Dim oRng As Word.Range
Set oRng = Selection.Range
With oRng.Find
.Text = "^p"
.Replacement.Text = " "
End With
Do While oRng.Find.Execute
With oRng
.Find.Execute Replace:=wdReplaceOne
End With
Loop
End Sub
---------------------------------------------------------------
the line breaks (only) in that selection and replace the linebreak
with a space.
How do I do that? The following code does not work properly. I am
using Word 2003.
Thank you.
---------------------------------------------------------------
Sub SelectionRemoveHardLineBreaks()
Dim oRng As Word.Range
Set oRng = Selection.Range
With oRng.Find
.Text = "^p"
.Replacement.Text = " "
End With
Do While oRng.Find.Execute
With oRng
.Find.Execute Replace:=wdReplaceOne
End With
Loop
End Sub
---------------------------------------------------------------