View Single Post
 
Old 06-09-2023, 10:12 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Font.StrikeThrough = True
    While .Execute
      oRng.InsertBefore "{"
      oRng.InsertAfter "}"
      oRng.Collapse wdCollapseEnd
      If oRng.End = ActiveDocument.Range.End Then Exit Do
    Wend
  End With
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Font.Underline = wdUnderlineWords
    Do While .Execute
      oRng.InsertBefore "["
      oRng.Collapse wdCollapseEnd
      oRng.Select
      oRng.Underline = wdUnderlineNone
      oRng.InsertAfter "]"
      If oRng.End = ActiveDocument.Range.End Then Exit Do
    Loop
  End With
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Font.Underline = wdUnderlineWords
    Do While .Execute
      oRng.Underline = wdUnderlineNone
      oRng.Collapse wdCollapseEnd
      If oRng.End = ActiveDocument.Range.End Then Exit Do
    Loop
  End With
lbl_Exit:
  Exit Sub
End Sub
Reply With Quote