Hi. I'm currently using the below VBA to find specific words (the myWords array) and then print those pages.
Code:
Sub PrintSpecificWords()
Dim myWords()
Dim j As Long
myWords = Array("Word1", "Word2", "Word3", "Word4", "Word5")
For j = 0 To UBound(myWords())
With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
Do While .Execute(FindText:=myWords(j), _
Forward:=True) = True
Application.PrintOut _
Range:=wdPrintCurrentPage
Loop
End With
End With
Next j
End Sub
I have attempted unsuccessfully to modify this to include additional code which would highlight the text found within the array after printing it (I plan to use this as to reconcile which pages have been printed).
Is there a way to do this using my existing "myWords" array?