View Single Post
 
Old 08-23-2015, 09:20 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
The second '.Execute Replace:=wdReplaceAll' is to allow for the possibility that a given word might contain two of the same character to be converted.

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]
Reply With Quote