View Single Post
 
Old 06-24-2020, 01:42 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Sub ScratchMacroI()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
    With oRng.Find
      .Text = "  "
      .MatchWildcards = True
      While .Execute
        oRng.InsertBefore "~"
        oRng.InsertAfter "~"
        oRng.HighlightColorIndex = wdYellow
        oRng.Collapse wdCollapseEnd
      Wend
    End With
lbl_Exit:
  Exit Sub
End Sub
Sub ScratchMacroII()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
    With oRng.Find
      .Text = "  "
      .MatchWildcards = True
      While .Execute
        oRng.MoveStart wdCharacter, -1
        oRng.MoveEnd wdCharacter, 1
        oRng.HighlightColorIndex = wdYellow
        oRng.Collapse wdCollapseEnd
      Wend
    End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote