|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
楼主,我写了个小宏,没有智能判断。如果量小可以手动添加短语,量大则须等待像 gbgbxgb 老师那样的高人,仅供参考:
- Sub FindSetUnderline()
- Dim arr, brr, i&
-
- arr = Array("was hard on", "is hard on")
- For i = 0 To UBound(arr)
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Text = arr(i)
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent.Font
- .Color = wdColorRed
- .Underline = wdUnderlineSingle
- .Bold = True
- End With
- Loop
- End With
- Next
-
- brr = Array("congratulate [!^32]@ on", "hit [!^32]@ down")
- For i = 0 To UBound(arr)
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Text = brr(i)
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent.Font
- .Color = wdColorPink
- .Underline = wdUnderlineDouble
- .Bold = True
- End With
- Loop
- End With
- Next
- End Sub
复制代码 |
|