![]() |
|
|
|
#1
|
|||
|
|||
|
I have a Word document in which I want to replace the uppercase letters by accented ones.
For instance ![]() subir fotos gratis This happened due to an error when replace some characters and you can not undo it. I tried with this option <?*[ó]*?> (just for the O letter), but I could not replace the words. Best Regards |
|
#2
|
||||
|
||||
|
You could use a macro like:
Code:
Sub Demo()
Dim i As Long, StrFnd As String, StrRep As String
StrFnd = "A,E,I,O,U"
StrRep = "á,é,í,ó,ú"
With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
For i = 0 To UBound(Split(StrFnd, ","))
.Text = "(<[A-Za-z]@)" & Split(StrFnd, ",")(i) & "(*>)"
.Replacement.Text = "\1" & Split(StrRep, ",")(i) & "\2" .Execute Replace:=wdReplaceAll
.Execute Replace:=wdReplaceAll
Next
End With
End Sub
For a manual wildcard Find/Replace, you'd use expressions like: Find = (<[A-Za-z]@)A(*>) Replace = \1á\2
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| wildcard |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
best way to use search/replace wildcards in this scenario?
|
dylansmith | PowerPoint | 3 | 03-04-2023 08:55 PM |
| Search all special characters in MS word 2007 | dshrish | Word | 3 | 03-28-2013 05:23 AM |
Word 2010: Wildcards Replace
|
tinfanide | Word | 2 | 09-10-2011 10:40 AM |
| Any wildcards search and replace in Powerpoint 2010? | tinfanide | PowerPoint | 0 | 09-10-2011 02:17 AM |
| special/escape/insertion characters in word | manojbmsce | Word | 0 | 09-25-2008 06:40 AM |