PDA

View Full Version : [SOLVED:] Removing Empty Line Breaks



vpsekhar
02-09-2015, 11:45 AM
Hi , it would great help for me if anyone let me know how to remove empty line breaks in word document

gmaxey
02-09-2015, 07:18 PM
Probably the easiest way is to use Find and Replace. Find ^l (that is a lower case el) and replace with nothing.

vpsekhar
02-10-2015, 07:00 AM
Hi Greg,
unfortunately i can not do that. All the lines in paragraph are ending with a line break. if i replace line break with space it will impact change paragraph alignment also.
Please suggest me to remove line break alone which are coming before section break.

gmaxey
02-10-2015, 07:44 AM
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "^l^b"
While .Execute
oRng.Characters(1).Delete
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub

vpsekhar
02-10-2015, 05:44 PM
Thanks a lot greg, its working perfectly.