Bookmark.NextStoryRange Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a Range object that refers to the next story, as shown in the following table.
public:
property Microsoft::Office::Interop::Word::Range ^ NextStoryRange { Microsoft::Office::Interop::Word::Range ^ get(); };
public Microsoft.Office.Interop.Word.Range NextStoryRange { get; }
member this.NextStoryRange : Microsoft.Office.Interop.Word.Range
Public ReadOnly Property NextStoryRange As Range
Property Value
a Range object that refers to the next story, as shown in the following table.
Examples
The following code example adds a Next page section break to the document and then adds a Bookmark control with text to the even page header of section 1. The code then uses NextStoryRange to add text to the header of section 2.
This example is for a document-level customization.
private void BookmarkNextStoryRange()
{
int WordTrue = -1;
object BreakType = Word.WdBreakType.wdSectionBreakNextPage;
this.Paragraphs[1].Range.InsertBreak(ref BreakType);
this.PageSetup.OddAndEvenPagesHeaderFooter = WordTrue;
Microsoft.Office.Tools.Word.Bookmark bookmark1 =
this.Controls.AddBookmark(this.Sections[1].Headers[
Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].Range,
"bookmark1");
bookmark1.Text = "Even Header 1";
this.Sections[2].Headers[Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages]
.LinkToPrevious = false;
bookmark1.NextStoryRange.Text = "Even Header 2";
}
Private Sub BookmarkNextStoryRange()
Me.Paragraphs(1).Range.InsertBreak(Word.WdBreakType.wdSectionBreakNextPage)
Me.PageSetup.OddAndEvenPagesHeaderFooter = True
Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
Me.Controls.AddBookmark(Me.Sections(1).Headers( _
Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages).Range, _
"Bookmark1")
Bookmark1.Text = "Even Header 1"
Me.Sections(2).Headers(Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages) _
.LinkToPrevious = False
Bookmark1.NextStoryRange.Text = "Even Header 2"
End Sub
Remarks
Story type | Item returned by the NextStoryRange method |
---|---|
wdMainTextStory, wdFootnotesStory, wdEndnotesStory, and wdCommentsStory | Always returns null . |
wdTextFrameStory | The story of the next set of linked text boxes. |
wdEvenPagesHeaderStory, wdPrimaryHeaderStory, wdEvenPagesFooterStory, wdPrimaryFooterStory, wdFirstPageHeaderStory, wdFirstPageFooterStory | The story of the same type in the next section. |