Find & Replace Multiple items

  • Thread starter Thread starter Albert
  • Start date Start date
A

Albert

Is it possible to use the find and replace tool or a
macro to find and replace an entire list of entries all
at once rather then entering each replacement one at a
time.
In other words apply multiple replacements of different
text to a document without entering each replacement.
So I can apply the whole list of changes to the current
document and save the list to apply to another document

1234 replaced with qwer
5678 replaced with kjuy
yuto replaced with 9754

ect.....
 
Hi, Albert,

It isn't possible through the ordinary dialog.

You (or someone else) can write a macro that would *appear* to do it. The
macro would read a file containing a table, with the original text in one
column and the replacement text in the other column; then it would do a
separate find/replace for each pair. Since you see only the request for the
file name, it would look like all the replacements are done at once, but
they really are not.

If you want to pursue this further, post the question in
microsoft.public.word.vba.beginners.
 
You need to do a multiple find and replace. For this you need a macro,
like this:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "1234"
.Replacement.Text = "qwer"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "5678"
.Replacement.Text = "kjuy"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "yuto"
.Replacement.Text = "9754"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
 
Back
Top