|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
要这种效果吗?- Sub test3()
- Dim otext As String
- Dim info As String
- Dim regEx As Object
- Dim aMatch As Object
-
- Application.ScreenUpdating = False
- With ActiveDocument.Content.Find '用特殊字符对下划线内容进行临时标记
- .Font.Underline = wdUnderlineWavy
- .Execute replacewith:="##^&##", Replace:=wdReplaceAll
- End With
-
- Set regEx = CreateObject("VBScript.Regexp")
- With regEx
- .Global = True
- .MultiLine = True
- .Pattern = "^(\d+)([..][^\r]*?##)"
- otext = .Replace(ActiveDocument.Content.Text, "##$1.##$2")
- ActiveDocument.Undo
- .Pattern = "^([①-⑩])([^\r]*?##)"
- otext = .Replace(otext, "##$1##$2")
- .Pattern = "^(\d+)([..][^\r]+\r##[①-⑩])"
- otext = .Replace(otext, "##$1.##$2")
- .Pattern = "##(.+?)##"
- For Each aMatch In .Execute(otext)
- info = info & aMatch.Submatches(0) & Space(2)
- Next
- .Pattern = "(\d+\.|[①-⑩]) "
- info = .Replace(info, "$1")
- End With
-
- Documents.Add.Content.Text = Trim(info)
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|