我习惯于从以下代码中选择特定Selection.Extend
文本:Start
End
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Start"
.Forward = True
.Wrap = wdFindStop
End With
Selection.Find.Execute
If Selection.Find.Found = False Then
Else
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "End"
.Forward = True
.Wrap = wdFindStop
End With
Selection.Find.Execute
End If
选择后我想通过以下代码在所选文本中找到“ABCD”:
Selection.Find.ClearFormatting
With Selection.Find
.Text = "ABCD"
.Forward = True
.Wrap = wdFindStop
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
MsgBox ("Found")
Else
MsgBox ("Not Found")
End If
但不是找到它,而是将选择扩展到ABCD
它找到的任何地方。
所以我的问题是我如何摆脱先前selection.Find.Execute
的选择和ABCD
内部Start
和End
?