word vba宏删除关键字字符之后的所有内容关键字保留

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

Sub 删除关键字字符之后的所有内容()

Selection.Find.ClearFormatting

With Selection.Find
    .Text = "中国人" '关键字保留
    .Forward = True
    .Wrap = wdFindContinue
End With
Selection.Find.Execute
range1 = Selection.End
Selection.Find.Execute
range2 = Selection.Start
ActiveDocument.Range(range1).Delete
'ActiveDocument.Range(range1, range2).Select

End Sub

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

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

标签: none

word vba宏删除关键字字符之后的所有内容关键字保留