![]() |
#2
|
||||
|
||||
![]()
You haven't selected anything, so a search in Selection.Range will not find anything.
Try the following: Code:
Sub findM() Dim strfind() As Variant Dim strreplace() As Variant Dim i As Integer strfind = Array("cE", "km") strreplace = Array("c?\u", "?") For i = 0 To UBound(strfind) Selection.HomeKey wdStory With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = strfind(i) .Format = True .Forward = True .MatchAlefHamza = False .MatchWildcards = False .MatchCase = True .MatchWholeWord = False .Replacement.Text = strreplace(i) .Execute Replace:=wdReplaceAll End With Next i End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
modiria50989 | Word VBA | 5 | 09-13-2017 04:01 PM |
![]() |
Madcat | Word | 1 | 08-23-2014 09:09 PM |
![]() |
Legaly | Excel | 2 | 05-23-2014 08:30 AM |
Replacing texts | aslamyahya | Excel Programming | 1 | 02-27-2013 10:38 PM |
Replacing a Resource in Multiple Tasks Simultaneously | taffytron | Project | 3 | 12-31-2012 02:21 PM |