|
请教一下:
有个文档,里面有若干字符,需要进行替换,如:
≌ --> \cong
△ --> \triangle
∠ --> \angle
...
目前我的方法是,选中需要进行替换的区域,
执行下面的宏
- Selection.Find.ClearFormatting
- Selection.Find.Replacement.ClearFormatting
- With Selection.Find
- .Text = "≌"
- .Replacement.Text = "\cong "
- .Forward = True
- .Wrap = wdFindStop
- .Format = False
- .MatchCase = False
- .MatchWholeWord = False
- .MatchByte = False
- .MatchWildcards = False
- .MatchSoundsLike = False
- .MatchAllWordForms = False
- End With
- Selection.Find.Execute Replace:=wdReplaceAll
-
- Selection.Find.ClearFormatting
- Selection.Find.Replacement.ClearFormatting
- With Selection.Find
- .Text = "△"
- .Replacement.Text = "\triangle "
- .Forward = True
- .Wrap = wdFindStop
- .Format = False
- .MatchCase = False
- .MatchWholeWord = False
- .MatchByte = False
- .MatchWildcards = False
- .MatchSoundsLike = False
- .MatchAllWordForms = False
- End With
- Selection.Find.Execute Replace:=wdReplaceAll
复制代码 但是,除了第一个符号以外,其它符号未被选中的区域也执行了替换。
因此想请教一下,是这个宏啥子地方写的有问题吗?
|
|