|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
但是速度很慢!但是包括表格中的字母及数字都可以,自己测试吧!!- Sub shishi()
- Dim pt$, f$, wd As Object, n&, m&, wdapp As Object
- Dim Arng As Object, oRang As Object, mt
- Application.ScreenUpdating = False
- Set wdapp = CreateObject("Word.Application")
- wdapp.Visible = False
- pt = ThisWorkbook.Path & ""
- f = Dir(pt & "*.doc*")
- Do While f <> ""
- Set wd = wdapp.Documents.Open(pt & f, Visible:=False)
- Set Arng = wd.Content
- With Arng.Find
- .Text = "[a-zA-Z0-9]{1,}"
- .MatchWildcards = True
- Do While .Execute
- .Parent.Font.Name = "Times New Roman"
- Loop
- End With
- wd.Close True
- f = Dir
- Loop
- wdapp.Quit
- MsgBox "操作完毕!"
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|