Skip to content

Instantly share code, notes, and snippets.

@Yiddishe-Kop
Created March 31, 2020 11:09
Show Gist options
  • Save Yiddishe-Kop/649d35a5a97daddbd7b105e3465fd3e1 to your computer and use it in GitHub Desktop.
Save Yiddishe-Kop/649d35a5a97daddbd7b105e3465fd3e1 to your computer and use it in GitHub Desktop.
Word script - replace text with certain highlight color
Sub replaceHighlights()
'Always start at the top of the document
Selection.HomeKey Unit:=wdStory
' wdPink - @@
' wdBrightGreen - @@@
With Selection.Find
.Text = "@"
Do While .Execute
If Selection.Find.Found Then
If Selection.Range.HighlightColorIndex = wdBrightGreen Then
''==================================
'' Do your footnote magic here
''==================================
Selection.Range.Text = "@@@"
End If
wUnits = Selection.Move(wdWord, 1)
End If
Loop
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment