StoryRanges Property Example

This example steps through the StoryRanges collection to determine whether wdPrimaryFooterStory is part of the StoryRanges collection.

For Each aStory In ActiveDocument.StoryRanges
    If aStory.StoryType = wdEvenPagesFooterStory Then 
        MsgBox "Document includes an even page footer"
    End If
Next aStory

This example adds text to the primary header story and then displays the text.

ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range _
    .Text = "Header text"
MsgBox ActiveDocument.StoryRanges(wdPrimaryHeaderStory).Text