Udostępnij za pośrednictwem


Document.StoryRanges Property (2007 System)

Gets a StoryRanges collection that represents all the stories in the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property StoryRanges As StoryRanges
'Usage
Dim instance As Document 
Dim value As StoryRanges 

value = instance.StoryRanges
[BrowsableAttribute(false)]
public StoryRanges StoryRanges { get; }
[BrowsableAttribute(false)]
public:
property StoryRanges^ StoryRanges {
    StoryRanges^ get ();
}
public function get StoryRanges () : StoryRanges

Property Value

Type: StoryRanges
A StoryRanges collection that represents all the stories in the document.

Examples

The following code example adds text to the document header and then displays a message that shows the text of the header.

This example is for a document-level customization.

Private Sub DocumentStoryRanges()
    Me.Sections(1).Headers(Word.WdHeaderFooterIndex.wdHeaderFooterPrimary).Range.Text _
        = "Header text"
    MessageBox.Show(Me.StoryRanges(Word.WdStoryType.wdPrimaryHeaderStory).Text)
End Sub
private void DocumentStoryRanges()
{
    this.Sections[1].Headers[Word.WdHeaderFooterIndex.
        wdHeaderFooterPrimary].Range.Text = 
        "Header text";
    MessageBox.Show (this.StoryRanges[
        Word.WdStoryType.wdPrimaryHeaderStory].Text);

}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace