StoryRanges Collection Object
Word Developer Reference |
A collection of Range objects that represent stories in a document.
Remarks
Use the StoryRanges property to return the StoryRanges collection. The following example removes manual character formatting from the text in all stories other than the main text story in the active document.
Visual Basic for Applications |
---|
|
The Add method is not available for the StoryRanges collection. The number of stories in the StoryRanges collection is finite.
Use StoryRanges(Index), where Index is a WdStoryType constant, to return a single story as a Range object. The following example adds text to the primary header story and then displays the text.
Visual Basic for Applications |
---|
|
The following example copies the text of the footnotes from the active document into a new document.
Visual Basic for Applications |
---|
|
If you attempt to return a story that is not available in the specified document, an error occurs. The following example determines whether a footnote story is available in the active document.
Visual Basic for Applications |
---|
|
Use the NextStoryRange property to loop through all stories in a document. The following example searches each story in the active document for the text "Microsoft Office Word." When the text is found, it is formatted as italic.
Visual Basic for Applications |
---|
|
See Also