|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub shishi()
- Dim col As New Collection, k&, j&
- Dim mt, oRang As Range, n&, m&
- ActiveDocument.Content.ListFormat.ConvertNumbersToText
- Set oRang = ActiveDocument.Content
- With CreateObject("vbscript.regexp")
- .Pattern = "\t+": .Global = True
- For Each mt In .Execute(oRang)
- k = k + 1
- m = mt.FirstIndex: n = mt.Length
- Set oRang = ActiveDocument.Range(m, m + n)
- col.Add oRang, CStr(k)
- Next
- End With
- For j = 1 To col.Count
- col(j) = ""
- Next
- End Sub
复制代码 |
|