View Single Post
 
Old 11-17-2025, 02:10 AM
RobiNew RobiNew is offline Windows 11 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 225
RobiNew is on a distinguished road
Default Replacing question mark plus wrong angle quotation mark

Hi! I need help to replace wrong "?«" with "?»", for the result is "«»". Here is the code:
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)" 'to find ?«
.Replacement.Text = "\1" & "^0187" 'to replace with ?»
.Execute Replace:=wdReplaceAll
End With
Next iType
End Sub
Reply With Quote