View Single Post
 
Old 11-17-2025, 07:29 AM
RobiNew RobiNew is offline Windows 11 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 225
RobiNew is on a distinguished road
Default

I have several instances of the type «Why?« that I want to change to «Why?». My code returns «Why«»
Sub AngleQuotationMarks()
Options.AutoFormatAsYouTypeReplaceQuotes = False
For iType = 1 To 2
Set oRng = ActiveDocument.StoryRanges(iType)
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Text = "\?" & "(^0171)" '(?«)
.Replacement.Text = "\1" & "^0187"
.Execute Replace:=wdReplaceAll
End With
Next iType
End Sub
Reply With Quote