Well, at least I can clean up the code from another browser... I hate that ugly block of unformatted code.
[VBA]
Sub TestBadStoryRanges()
Dim r As Range
For Each r In ActiveDocument.StoryRanges
Select Case r.StoryType
Case wdEvenPagesFooterStory, wdEvenPagesHeaderStory, wdFirstPageFooterStory, wdFirstPageHeaderStory,_
wdPrimaryFooterStory, wdPrimaryHeaderStory
' r.Select
Debug.Print Replace(r.Paragraphs.First.Range.Text, vbCr, "")
End Select
Next
End Sub


Sub TestGoodStoryRanges()
Dim r As Range
For Each r In fGetStoryRanges
Debug.Print Replace(r.Paragraphs.First.Range.Text, vbCr, "")
Next
End Sub
'----------------------------------------------------------------------------------------------
'The MS StoryRanges collection is fundamentally broken when trying to search headers/footers
'as well, since a for each loop doesn't return unlinked headers
'This is an attempt to generate an accurate collection of story ranges for the passed document.
'Uses the activedocument (if any) if no document is passed'doesn't currently return ranges of any textboxes
'----------------------------------------------------------------------------------------------
Public Function fGetStoryRanges(Optional oDoc As Document, _
Optional bHeadersFootersOnly As Boolean = True,
Optional bAddHeadersFootersOnlyIfShowing As Boolean = True) As Collection
Dim colRet As Collection
Dim rngStory As Range
Dim hf As HeaderFooter
Dim oSec As Section
On Error GoTo l_err
Set colRet = New Collection
If oDoc Is Nothing Then
Set oDoc = ActiveDocument
End If
'easy story ranges, if desired
If bHeadersFootersOnly = False Then
For Each rngStory In oDoc.StoryRanges
Select Case rngStory.StoryType
Case wdCommentsStory, wdFootnotesStory, wdEndnotesStory, wdMainTextStory
colRet.Add rngStory.Duplicate
End Select
Next
End If
'headers/footers (for each of story ranges not reliable!!)
For Each oSec In oDoc.Sections
For Each hf In oSec.Headers
'don't add linked ranges
If hf.LinkToPrevious = False Or oSec.Index = 1 Then
'don't add hidden ranges, unless specified
If bAddHeadersFootersOnlyIfShowing And hf.Exists _
Or bAddHeadersFootersOnlyIfShowing = False Then
colRet.Add hf.Range.Duplicate
End If
End If
Next


For Each hf In oSec.Footers
'don't add linked ranges
If hf.LinkToPrevious = False Or oSec.Index = 1 Then
'don't add hidden ranges, unless specified
If bAddHeadersFootersOnlyIfShowing And hf.Exists _
Or bAddHeadersFootersOnlyIfShowing = False Then
colRet.Add hf.Range.Duplicate
End If
End If
Next
Next
l_exit:
Set fGetStoryRanges = colRet
Exit Function
l_err:
'any errors, blackbox and return an empty collection
Set colRet = New Collection
Resume l_exit
End Function
[/VBA]

For the OP - for your purposes, you could comment out the block which returns ranges not in the header/footer -- but I leave that in for this sample code, so others may see the parts of the story ranges collection which works, and the ones that don't