Quantcast
Viewing all articles
Browse latest Browse all 7205

How to obtain a specific section content


This example illustrates how to obtain the content of a Section which the caret position belongs to. There is no direct method to obtain the section range. However, you can construct this range based on section paragraphs:

[C#]
...DocumentPositioncurrentSectionStart=currentSection.Paragraphs[0].Range.Start;DocumentPositioncurrentSectionEnd=currentSection.Paragraphs[currentSection.Paragraphs.Count- 1].Range.End;...

After that you can use the SubDocument.GetText Method to obtain the section content.

In addition, we illustrate how to calculate the current section and paragraph index.

See Also:

SubDocument essentials - simple examples

How to reset page numbering on a specific page

How to apply different headers/footers to different pages

How to merge documents with headers and footers into a single document


Viewing all articles
Browse latest Browse all 7205

Trending Articles