我的单词中包含以下内容:
“b)VergabeverfahrenÖffentlicheAusschreibung,VOB / A Vergabenummer 13A0295S。”
是否可以在本段中同时选择以下两个单词。
“b)Vergabeverfahren”和“Vergabenummer”
原因是我想将选择颜色更改为红色。我可以使用此代码成功选择一个单词。但选择两个单词对我来说有点问题。
这是我的代码:
Selection.Start = singleLine.range.Start
Selection.End = singleLine.range.End
ReplaceText = StrFrmDll ' StrFrmDll contains the paragraph.
Selection.Find.ClearFormatting
With Selection.Find
.Text = ReplaceText
.Replacement.Text = ReplaceText
.Replacement.Font.Hidden = True
.ClearFormatting
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
End With
Selection.Find.Execute Replace:=wdReplaceOne
Selection.Font.Color = wdColorRed
答案 0 :(得分:0)
只需做两个Selection.Find的
Selection.Find.ClearFormatting
With Selection.Find
.Text = Vergabeverfahren
.Replacement.Font.Hidden = True
.ClearFormatting
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
End With
Selection.Find.Execute Replace:=wdReplaceOne
Selection.Font.Color = wdColorRed
Selection.Find.ClearFormatting
With Selection.Find
.Text = Vergabenummer
.Replacement.Font.Hidden = True
.ClearFormatting
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
End With
Selection.Find.Execute Replace:=wdReplaceOne
Selection.Font.Color = wdColorRed