View Single Post
 
Old 12-21-2017, 03:58 PM
onlywonderboy onlywonderboy is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Feb 2017
Posts: 5
onlywonderboy is on a distinguished road
Default Issue with Accented Letter Replacement (Upper/Lower Case)

Hey all,

I'm using a macro that strips out special characters from word documents. This is the code I've been using for find and replace:
Code:
With Selection.Find
.ClearFormatting
.Text = "Á"
.Replacement.ClearFormatting
.Replacement.Text = "A"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With

With Selection.Find
.ClearFormatting
.Text = "á"
.Replacement.ClearFormatting
.Replacement.Text = "a"
.Execute Replace:=wdReplaceAll, Forward:=True, _
Wrap:=wdFindContinue
End With
This has worked with most characters, but I'm having an issue with accented characters. Both Á and á are being replaced with A (instead of A and a respectively). Anyone have any suggestions on how to resolve this? Thanks!
Reply With Quote