|
按照你希望的方式写了一个代码。
此代码和我之前写的代码效果相同。之前写的通过遍历数组的方式,把"我们", "大家好", "你", "x"……几个关键词放入数组,比较简洁。
===============================
Sub d2()
ActiveDocument.Content.Find.Execute FindText:="我们", ReplaceWith:="hello", Replace:=wdReplaceAll
ActiveDocument.Content.Find.Execute FindText:="大家好", ReplaceWith:="hello", Replace:=wdReplaceAll
ActiveDocument.Content.Find.Execute FindText:="你", ReplaceWith:="hello", Replace:=wdReplaceAll
ActiveDocument.Content.Find.Execute FindText:="x", ReplaceWith:="hello", Replace:=wdReplaceAll
End Sub
|
|