我有一个宏跳转到文档中下一个红色文本。
它可以正常工作,直到它到达一个全红色的段落(包括段落标记)。然后它继续在文档中前进,直到我向前移动光标并再试一次。
我还注意到,当光标位于段落中时,如果我运行宏,则只会突出显示从光标到段落末尾的文本。 我怀疑我需要使用某种形式的崩溃'?有人可以建议吗?
以下是代码:
Sub Find_Red_Text()
With ActiveDocument.ActiveWindow
.ActivePane.View.SeekView = wdSeekMainDocument
Selection.Find.ClearFormatting
Selection.Find.Font.Color = wdColorRed
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
End With
End Sub