This example displays the number of the sections of a document.
TextSections sections = document.getSections(); System.out.println(sections.getCount());
Related information
Count property