Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to obtain a specific section content

$
0
0

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.

Upd. Starting from the v18.1.4, the RichEditControl is provided with the Section.Range property to obtain the section range. 

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



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>