Sub aaa()
Ori = Array("a", "b", "c") '被替换文本
Rep = Array("aa", "bb", "cc") '替换后的文本
For i = 0 To UBound(Ori)
'MsgBox Ori(i)
With Selection.Find
.Text = Ori(i)
.Forward = True
.Wrap = wdFindContinue
.Format = False '不查找格式
.MatchCase = False '不区分大小写
' .MatchWholeWord = False '不采用全字匹配
' .MatchByte = False '不区分全半角
' .MatchWildcards = False '不使用通配符
'.MatchSoundsLike = False '不查找同音
' .MatchAllWordForms = False '不查找单词的所有形式
.Replacement.Text = Rep(i)
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAll
Next
End Sub
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询