I use the macro below to correct words in a text.
However I have dozens of words to correct in dozens of files!
How could I use a loop (if possible) to enter two lists of words (the old - the new) in order not to copy paste dozens of small macros such as below ?
( I have to duplicate the macro when the program is too big )
Thanks for your attention and for your help !
Cheers,
Lenrubé
Sub tipee
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "inaccuratly"
.Replacement.Text = "inaccurately"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "presance"
.Replacement.Text = "presence"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "assment"
.Replacement.Text = "assessment"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
However I have dozens of words to correct in dozens of files!
How could I use a loop (if possible) to enter two lists of words (the old - the new) in order not to copy paste dozens of small macros such as below ?
( I have to duplicate the macro when the program is too big )
Thanks for your attention and for your help !
Cheers,
Lenrubé
Sub tipee
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "inaccuratly"
.Replacement.Text = "inaccurately"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "presance"
.Replacement.Text = "presence"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "assment"
.Replacement.Text = "assessment"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub