|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 duquancai 于 2016-11-28 11:42 编辑
- Sub SelectAll()
- Dim S As Range, n&, P As Range
- Set P = ActiveDocument.Content
- With P.Find
- Do While .Execute("[一-﨩^13^11][^1-^47^58-^62^91-^96^123-^127\?\@]@[一-﨩^13^11]", MatchWildcards:=True)
- Set S = .Parent.Duplicate
- With S.Find
- Do While .Execute("[!一-﨩^13^11]{1,}", MatchWildcards:=True)
- If .Parent.Start > P.End Then Exit Do
- n = n + 1
- .Parent.Editors.Add wdEditorEveryone
- Loop
- End With
- Loop
- If n = 0 Then Exit Sub
- P.GoToEditableRange.Editors(1).SelectAll
- P.GoToEditableRange.Editors(1).DeleteAll
- End With
- End Sub
复制代码 |
|