Created
March 31, 2020 11:09
-
-
Save Yiddishe-Kop/649d35a5a97daddbd7b105e3465fd3e1 to your computer and use it in GitHub Desktop.
Word script - replace text with certain highlight color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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