![]() |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
You need to tell Word to match the Find/Replace case:
Code:
With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .MatchCase = True .Wrap = wdFindContinue .Text = "Á" .Replacement.Text = "A" .Execute Replace:=wdReplaceAll .Text = "á" .Replacement.Text = "a" .Execute Replace:=wdReplaceAll End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| lower/upper | xor | Excel | 0 | 09-01-2016 07:46 AM |
| No upper and lower borders | Diane | Word | 2 | 04-25-2014 10:31 PM |
Regular expressions: lower case after hyphen
|
SusanG | Word | 2 | 06-06-2012 11:58 PM |
From all UPPER CASE to Proper Case
|
davers | Word | 1 | 04-30-2009 12:41 PM |
| Upper to lower case | jd | Excel | 1 | 04-28-2006 07:40 AM |