View Single Post
 
Old 05-25-2021, 03:20 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

As I said earlier, it is better to avoid the extra paragraphs in the first place.

The find/replace method is fast but a slower method of removing the empty paragraphs will also work without the side-effect.
Code:
Sub KillEmpties()
  Dim i As Long
  For i = ActiveDocument.Paragraphs.Count To 1 Step -1
    If Len(ActiveDocument.Paragraphs(i).Range.Text) = 1 Then ActiveDocument.Paragraphs(i).Range.Delete
  Next i
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote