You are still faced with the problem Paul identified:
Public Sub FRAnywhere()
Dim rngStory As Word.Range
Dim arrKeyWords() As String
Dim lngValidate As Long
Dim oShp As Shape
Dim lngIndex As Long
arrKeyWords = Split("Apple,Peach,Pare", ",")
lngValidate = ActiveDocument.Sections(1).Headers(1).Range.StoryType
ResetFRP Selection.Range
For lngIndex = 0 To UBound(arrKeyWords)
'Iterate through all story types in the current document
For Each rngStory In ActiveDocument.StoryRanges
'Iterate through all linked stories
Do
FlagInStory rngStory, arrKeyWords(lngIndex)
On Error Resume Next
Select Case rngStory.StoryType
Case 6, 7, 8, 9, 10, 11
If rngStory.ShapeRange.Count > 0 Then
For Each oShp In rngStory.ShapeRange
If Not oShp.TextFrame.TextRange Is Nothing Then
FlagInStory oShp.TextFrame.TextRange, arrKeyWords(lngIndex)
End If
Next
End If
Case Else: 'Do Nothing
End Select
On Error GoTo 0
'Get next linked story (if any)
Set rngStory = rngStory.NextStoryRange
Loop Until rngStory Is Nothing
Next
Next lngIndex
lbl_Exit:
Exit Sub
End Sub
Public Sub FlagInStory(ByVal rngStory As Word.Range, ByVal strFind As String)
With rngStory.Find
.ClearFormatting
.Text = strFind
While .Execute
rngStory.Font.ColorIndex = wdBlue
rngStory.Collapse wdCollapseEnd
Wend
End With
lbl_Exit:
Exit Sub
End Sub
Sub ResetFRP(oRng As Range)
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
lbl_Exit:
Exit Sub
End Sub