2,462
社区成员
发帖
与我相关
我的任务
分享
ActiveDocument.Paragraphs(2).Range.Select '将第二段中的你好替换成ok
With Selection.Find
.Text = "你好"
.ClearFormatting
.Replacement.Text = "ok"
.Replacement.ClearFormatting
.Execute Replace:=wdReplaceAll, Forward:=True
End With
End Sub
按章节查找替换
Sub Documents()
ActiveDocument.Sections(1).Range.Select '替换第一章节
With Selection.Find
.Text = "你好"
.ClearFormatting
.Replacement.Text = "ok"
.Replacement.ClearFormatting
.Execute Replace:=wdReplaceAll, Forward:=True
End With
End Sub