Left quotation mark switches places with first letter of a word

S

Staroslav

Hello!
I have a Find/Replace (FR) procedure that for some unknown to me reason
flips around the first letter of a word with the left quotation mark, so
"This" becomes T"his". Can any one help explain why that happens and offer a
working solution?

Here is the code I am using:

Call FR("([^0034^0171^0148])([Ð-Ñ‘ÐA-Za-z0-9])", "^0147\2", True)

Sub FR(FT As String, RT As String, _
Optional bWild As Boolean = False, _
Optional bFormat As Boolean = False)
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Text = ""
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Text = ""
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = FT
.Replacement.Text = RT
.Forward = True
.Wrap = wdFindStop
.Format = bFormat
If bFormat = True Then
.Replacement.Font.Bold = False
.Replacement.Font.Italic = False
End If
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = bWild
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute
'Keep going until nothing found
.Execute Replace:=wdReplaceAll
Loop
'Free up some memory
ActiveDocument.UndoClear
End With
Selection.Find.ClearFormatting
Selection.Find.Text = ""
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Text = ""
Selection.Find.MatchWildcards = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top