StoryRanges 属性

       

该属性返回一个 StoryRanges 集合,该集合代表指定文档中的所有的文字部分。只读。

有关返回集合中单个成员的内容,请参阅返回集合中的对象

示例

本示例检查 StoryRanges 集合中的每一个元素,判定 wdPrimaryFooterStory 是否为 StoryRanges 集合的一部分。

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

本示例将文字添至文档页眉部分,然后显示该文字。

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