|
楼主,既然上面手动方法不行,那么还是试试 VBA 宏代码吧!(如果不会用宏,则请百度之!)
- Sub aaab设置颜色()
- Dim i&, j$, k$
- If Selection.Type = wdSelectionIP Then MsgBox "请选择一个希望变色的字符!", 0 + 16: End
- j = MsgBox("<是>:蓝色 <否>:红色 <取消>:粉红", 3 + 48, "请选择颜色!")
- If j = vbYes Then
- k = wdColorBlue
- ElseIf j = vbNo Then
- k = wdColorRed
- Else
- k = wdColorPink
- End If
- i = Selection.Font.Color
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Font.Color = i
- With .Replacement
- .ClearFormatting
- .Font.Color = k
- End With
- .Execute findtext:="", replacewith:="", Format:=True, Replace:=wdReplaceAll
- End With
- End Sub
复制代码 |
|