DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: Microsoft Word VBA - how to condense fragmented paragraphs that are highlighted?

The code you gave is simply wrong, please correct it!

The easiest way to compare text is to use highlighting conditions:

Sub CondenseZap()
    Dim rngTemp As Range, ur As UndoRecord
 
    Rem do this, it only takes one step when undo
    Set ur = Word.Application.UndoRecord
    ur.StartCustomRecord "CondenseZap"
    Set rngTemp = ActiveDocument.Range

Top comments (0)