Represents a section of a document.
For a list of all members of this type, see Section Members.
System.Object
Aspose.Editor.Desktop.Section
[Visual Basic]
NotInheritable Public Class Section
[C#]public sealed class Section
Remarks
You do not create instances of this class directly. You can create or obtain Section objects from the Sections collection. The Sections collection, in turn, is available from a Range object.
A section in a Microsoft Word document defines page size, orientation, margins, number of text columns, headers and footers. One document can have multiple sections. In a document, sections are separated by section breaks.
Example
Iterates over all paragraphs in a section and prints their text.
[C#]
Document doc = new Document(MyPath + "Welcome.xml");
Range docRange = doc.GetRange();
Section section = docRange.Sections[0];
Paragraphs paragraphs = section.GetRange().Paragraphs;
for (int i = 0; i < paragraphs.Count; i++)
{
Paragraph para = paragraphs[i];
Console.WriteLine("Paragraph {0}: {1}", i, para.GetRange().Text);
}
[Visual Basic]
Dim doc As New Document(MyPath & "Welcome.xml")
Dim docRange As Range = doc.GetRange()
Dim section As Section = docRange.Sections(0)
Dim paragraphs As Paragraphs = section.GetRange().Paragraphs
For i As Integer = 0 To paragraphs.Count - 1
Dim para As Paragraph = paragraphs(i)
Console.WriteLine("Paragraph {0}: {1}", i, para.GetRange().Text)
Next iRequirements
Namespace: Aspose.Editor.Desktop
Assembly: Aspose.Editor.Desktop (in Aspose.Editor.Desktop.dll)
See Also
Section Members | Aspose.Editor.Desktop Namespace | Range