Sub affCountry()
'先检测出来最后一个单词,然后遍历最后一个单词的所有字符,如果不是英文就高亮出来
Dim affCount, i As Integer
Dim c As Range
Selection.HomeKey wdStory
With Selection.Find
.ClearFormatting
.Text = "Correspondence:"
.MatchWildcards = False
.Replacement.Text = ""
.Execute
End With
Dim l As Integer
Dim myrange As Range
Set myrange = ActiveDocument.Range(ActiveDocument.Paragraphs(3).Range.Start, Selection.Start)
affCount = myrange.Paragraphs.count
For i = 4 To 1 + affCount
ActiveDocument.Paragraphs(i).Range.Select
If InStr(Selection.Text, ";") > 0 Then
l = InStr(Selection.Text, ";")
Selection.Collapse wdCollapseStart
Selection.MoveRight wdCharacter, l - 2
Selection.Words(1).Select
'遍历所有字符
Else
Selection.Words.last.Previous.Words(1).Select
End If
For Each c In Selection.Range.Characters
If FunctionGroup.isWord(c.Text) = False Then
c.HighlightColorIndex = wdRed
End If
Next
Next
End Sub