VBA替换Word文档内容

180it 2019-09-25 PM 2595℃ 0条

Sub MReplacement()
Selection.Find.ClearFormatting

   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
   .Text = "txt文本"
   .Replacement.Text = "www.txttool.com"
   .Forward = True
   .Wrap = wdFindAsk
   .Format = False
   .MatchCase = False
   .MatchWholeWord = False
   .MatchByte = True
   .MatchWildcards = False
   .MatchSoundsLike = False
   .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll

Application.ScreenUpdating = True
End Sub

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

VBA替换Word文档内容