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)