我在Word 2003中有一个VBA代码,它取代了一些XML实体。尽管开头为\u2018
,但以下代码仍会将'
替换为Options.AutoFormatAsYouTypeReplaceQuotes = False
,而不仅仅是\u0027
。
有关此行为和任何已知解决方案/解决方法的原因的任何建议?
代码:
Options.AutoFormatAsYouTypeReplaceQuotes = False
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.MatchWildcards = False
.Wrap = wdFindStop
.Text = "&"
.Replacement.Text = "&"
.Execute Replace:=wdReplaceAll
.Text = Chr(34)
.Replacement.Text = """
.Execute Replace:=wdReplaceAll
.Text = ChrW(&H27) ' "'"
.Replacement.Text = "'"
.Execute Replace:=wdReplaceAll
End With
提前致谢。