|
本帖最后由 duquancai 于 2016-10-17 14:14 编辑
如果需要替换的数量巨大(或者很多文件,总之量很大!!!),可以考虑一下程序,体验一下速度的快感!!!- Sub 数字替换为带圈数字()
- ' Word文档为纯文本(无表格)
- Dim arr, S$
- S = ActiveDocument.Content.Text
- Set d = CreateObject("Scripting.Dictionary")
- arr = Array("①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨", "⑩")
- For i = 1 To 10
- d(i) = arr(i - 1)
- Next
- k = d.keys: t = d.items
- With CreateObject("VBScript.Regexp")
- .Global = True
- For i = 0 To d.Count - 1
- .Pattern = k(i): S = .Replace(S, t(i))
- Next
- End With
- ActiveDocument.Content.Text = S
- End Sub
复制代码 |
|