For most of the documents I work with, I need to highlight instances of Asian font (such as SimSun, MS Mincho).
I put together the the code below - it works well but it doesn't highlight Asian font characters within non-Asian words (such as the apostrophe in "it's").
Sub HighlightAsian2019()
Dim aWord
For Each aWord In ActiveDocument.Words
If aWord.Font.Name = "SimSun" Then
aWord.FormattedText.HighlightColorIndex = wdTurquoise
End If
Next aWord
For Each aWord In ActiveDocument.Words
If aWord.Font.Name = "MS Mincho" Then
aWord.FormattedText.HighlightColorIndex = wdTurquoise
End If
Next aWord
End Sub
Can anyone help me improve the code so that ALL instances of SimSun and MS Mincho in the text are highlighted?
Any help will be greatly appreciated!
Use this Loop:
You can use the
.Charactersproperty of Range to access the alphabets. Add another If condition for other fonts to check