As I said in post #5:
Quote:
Originally Posted by macropod
Find/Replace can't be used to delete an empty paragraph before a table - even with a macro.
|
A macro you could use is:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[^13]{2,}"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
.Wrap = wdFindStop
End With
Do While .Find.Execute
.End = .End - 1
.Text = vbNullString
.Collapse wdCollapseEnd
Loop
End With
Application.ScreenUpdating = True
End Sub
The 'wdReplaceAll' reduces all consecutive paragraph breaks other than before a table to single paragraph breaks; the loop handles consecutive paragraph breaks before tables.