Skip to content

Latest commit

 

History

History
61 lines (36 loc) · 1.43 KB

Word.Document.StoryRanges.md

File metadata and controls

61 lines (36 loc) · 1.43 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Document.StoryRanges property (Word)
vbawd10.chm158007352
vbawd10.chm158007352
Word.Document.StoryRanges
6afc9e1a-950c-e1b0-15d5-73afeb72fc59
06/08/2017
medium

Document.StoryRanges property (Word)

Returns a StoryRanges collection that represents all the stories in the specified document. Read-only.

Syntax

expression. StoryRanges

expression A variable that represents a Document object.

Remarks

For information about returning a single member of a collection, see Returning an object from a collection.

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

See also

Document Object

[!includeSupport and feedback]