|
代码A
sub A()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "K?“
.Replacement.Text = "K"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
代码B
sub B()
If Selection.Start <> Selection.End Then ActiveDocument.Range(Selection.Start, Selection.End).Find.Execute findtext:="K", replacewith:="W", Replace:=wdReplaceAll
End Sub
想把B的代码加入到A中,实现指定区域替换(变量替换),如何修改。
|
|