View Single Post
 
Old 01-27-2022, 12:00 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,602
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Sub PrintSpecificWordsII()
Dim myWords()
Dim lngIndex As Long
Dim oRng As Range
myWords = Array("Word1", "Word2", "Word3", "Word4", "Word5")
For lngIndex = 0 To UBound(myWords)
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Text = myWords(lngIndex)
.Forward = True
While .Execute
oRng.HighlightColorIndex = wdBrightGreen
Application.PrintOut Range:=wdPrintCurrentPage
oRng.Collapse wdCollapseEnd
Wend
End With
Next lngIndex
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote