Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2015, 07:08 PM
mauuuuu5 mauuuuu5 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 64bit
Novice
Search and Replace special characters between word using wildcards
 
Join Date: Aug 2015
Posts: 3
mauuuuu5 is on a distinguished road
Default Search and Replace special characters between word using wildcards

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
Reply With Quote
  #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: 21,962
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
Reply

Tags
wildcard



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 10:42 AM.


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