Author Topic: Command to put paragraph in one line.  (Read 3017 times)


  • Senior Community Member
  • Posts: 177
  • Hero Points: 2
Command to put paragraph in one line.
« on: October 30, 2016, 08:18:03 pm »
Hi All,

Is there a command that will do the opposite of reflow-paragraph. I want to take some paragraphs written in this editor and copy them to word, but that does not work well. The only way I can get it to work is if I can make each paragraph be one line in Slickedit and let MS Word handle the word wrapping.

Any help appreciated,


  • Senior Community Member
  • Posts: 2518
  • Hero Points: 327
Re: Command to put paragraph in one line.
« Reply #1 on: October 31, 2016, 11:23:06 am »
You can use a regular expression to change linebreaks to spaces in a selection.

Code: [Select]
   replace_buffer_text('\n',"RI?M*",' ','1','0','0','0','0','0','1');

but if you try to use undo to restore the linebreaks it doesn't work.
Hence you might want to copy to a temporary file first

Code: [Select]
   replace_buffer_text('\n',"RI?M*",' ','1','0','0','0','0','0','1');

Here's a word macro that removes line breaks in a selection - as posted here

Code: [Select]
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Set oRng = Selection.Range
  If oRng.Characters.Last = Chr(13) Or oRng.Characters.Last = Chr(11) Then
    oRng.End = oRng.End - 1
  End If
  oRng.Text = Replace(Replace(oRng.Text, Chr(11), " "), Chr(13), " ")
  Exit Sub
End Sub