- Sub a_test_range()
- Dim r As Range, s As Range, t As Range
- With Selection
- If .Type = 1 Then MsgBox "Not-Select!", 0 + 16: End
- Set r = .Range
- Set s = .Range
- With r.Find
- .ClearFormatting
- .Text = "\(*\)"
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- .Font.Color = wdColorRed
- Set t = ActiveDocument.Range(Start:=.Start, End:=.End)
- With t.Find
- .Execute "$", , , 1, , , , , , "", 2
- .Execute ",", , , 1, , , , , , ",", 2
- End With
- End With
- r.SetRange Start:=r.End, End:=s.End
- Loop
- End With
- End With
- End Sub
复制代码 |