kerrypnx
11/21/2018 - 1:38 AM

检测四位数有逗号,超过四位数无逗号的情况

revise 11-21

Sub fourFiveDigit()
    With ActiveDocument.Content.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "<[0-9],[0-9]{3}>"
        .MatchWildcards = True
        .Replacement.Text = ""
        .Replacement.highlight = True
        .Execute Replace:=wdReplaceAll
        
    End With
    With ActiveDocument.Content.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "<[0-9]{4,}>"
        .MatchWildcards = True
        .Replacement.Text = ""
        .Replacement.highlight = True
        .Execute Replace:=wdReplaceAll
        
    End With
End Sub