View Single Post
 
Old 06-24-2017, 02:22 PM
eduzs eduzs is offline Windows 10 Office 2010 32bit
Expert
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default Replacing till there's no more double paragraphs in the text

Search for "^p^p" and replace with "^p" loop this until it no find any one more "^p^p" in the active document.

I have this code:

(it's not working, its resulting in freeze/loop/crash word)

Dim oRng As Range

Set oRng = ActiveDocument.Range

With oRng.Find

.Wrap = wdFindStop

Do While .Execute(FindText:="^p^p",replacewith:="^p")

Loop

End With
__________________
Backup your original file before doing any modification.
Reply With Quote