|
试试这个,注意在你要查找的文档中运行
- sub 调用子程序查找()
- Call 查找("([!^13]{1,})卷([一二三四五六七八九十]{1,}):", 1, 0)
- end sub
- Function 查找(文本, 通配符, 向下)
- Selection.Find.Font.Reset
- Selection.Find.ParagraphFormat.Reset
- With Selection.Find
- .Text = 文本
- .Forward = 向下
- .Wrap = wdFindContinue
- .MatchCase = True
- .MatchByte = True
- .MatchWildcards = 通配符
- .MatchWholeWord = False
- .MatchFuzzy = False
- .Replacement.Text = ""
- End With
- With Selection.Find
- .Style = ""
- .Highlight = wdUndefined
- With .Replacement
- .Style = ""
- .Highlight = wdUndefined
- End With
- End With
- Selection.Find.Execute Replace:=wdReplaceNone
- Selection.Find.Replacement.Text = ""
-
- Selection.Find.Font.Reset
- Selection.Find.ParagraphFormat.Reset
- End Function
复制代码 |
|