Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-23-2015, 09:20 PM
macropod's Avatar
macropod macropod is offline Search and Replace special characters between word using wildcards Windows 7 64bit Search and Replace special characters between word using wildcards 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
 

Tags
wildcard

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace special characters between word using wildcards 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
Search and Replace special characters between word using wildcards 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft