|
* 楼主:你的要求,一个程序就搞定。请注意:如果不选则全选。
- Sub aaaa_FindRange_清除底色_青绿()
- Dim r As Range, s As Range, i&, n&
- With Selection
- If .Type = wdSelectionIP Then
- Set r = ActiveDocument.Content
- Else
- Set r = .Range
- Set s = .Range
- i = 1
- End If
- End With
- With r.Find
- .ClearFormatting
- .Text = ""
- .Font.Shading.BackgroundPatternColor = 16777088
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- n = n + 1
- .Font.Shading.BackgroundPatternColor = wdColorAutomatic
- If i = 1 Then .SetRange Start:=.End, End:=s.End Else .Start = .End
- End With
- Loop
- End With
- MsgBox "共找到 " & n & " 个!", 0 + 48
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|