Answer the question
In order to leave comments, you need to log in
Quick find and replace in Word?
Good afternoon!
If the document is ~350 pages. At the end of the document (only on the last pages) there are unique marks like p***p, *** - corresponds to any value from the dictionary. The task is to replace these labels with their dictionary equivalents and change their color to black.
Here is an example written:
For Each Key In dic.Keys
newText = dic.Item(Key)
objWrd.Selection.EndKey 'т.к. странице лежат в конце, начинаем поиск оттуда
With objWrd.Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = Key
.Replacement.Text = newText
.Forward = True
.Wrap = 2
.Format = False
.MatchCase = False
.MatchWholeWord = False
End With
objWrd.Selection.Find.Execute , , , , , , , , , , 1
objWrd.Selection.Font.Color = -587137025
Next
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question