There seems to be a problem when trying to get different kinds o quote characters when replacing text:
With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\{QUOTE:(*):QUOTE\}"
.Replacement.Text = Chr(147) & "\1" & Chr(148)
.Forward = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
When the document contains: {QUOTE:abc:QUOTE}
the code gives: ”abc”
but expected result is: “abc”
Versions of Word: “Microsoft Office Professional Plus 2013” and “Microsoft Office 365 ProPlus”.
The problem does not happen when File->Options->Proofing->AutoCorrect Options->AutoFormat As You Type->Replace as you type->"Straight quotes" with “smart quotes” is not activated. Of course I want the macro to work regardless of any setting for manual typing.
How can the code be changed to get the expected result?