Description
This class is used to represent a section of the document. Many documents will only contain one section. More complex documents will divide the document into multiple sections. A section can be roughly correlated to a chapter in a book. Each section can have different formatting settings, including:
C#
vb.net
Remarks
To create a new section, use Element.CreateSectionBefore().
To get an existing section, use Document.Sections.
The following sample shows you how to get the add a new section to a document and how to get the first section of a document.
Examples
C#
vb.net
Properties
Name |
Description |
---|---|
Sets or returns a boolean that represents whether or not page borders for this section will always display in front of any objects it may overlap. |
|
Sets or returns a BorderArea object that represents where the page border will be applied to. | |
Sets or returns a boolean that represents whether or not the padding for this section's page border will be measured from the edge of the page or from the text it surrounds. |
|
Sets or returns an int that represents the vertical distance of the bottom margin from the bottom edge of the page for this section. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a Section.BreakType object that represents the type of break (before) this section. There are 5 types of breaks: Continuous, Column, Page, EvenPage, and OddPage. | |
Sets or returns an int that represents the number that the line numbering starts at for this section. |
|
Sets or returns an int that represents the number that the page numbering starts at for this section. |
|
Sets or returns an int that represents the y coordinate of the footer measured from the top edge of the page. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns an int that represents the gutter width for this section. The gutter adds space to the margin. Gutters are used when a document needs additional space to allow for binding. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a boolean that represents whether or not this section has a title page. This can affect page numbering and the appearance of headers and footers. |
|
Sets or returns an int that represents the y coordinate of the header measured from the top edge of the page. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns an int that represents the horizontal distance of the left margin from the left edge of the page for this section. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a Section.LineNumbering object that represents the line numbering restart policy for this section. There are 3 options: | |
Sets or returns an int that represents the x position of line numbers in twips. One twip = (1/20 pt) or ( 1/1440 in) |
|
Sets or returns an int that represents the line numbering modulus. This setting is used to set whether line numbers display on every line, every 2nd line, etc. Setting this to 0 (zero) will display no line numbers. Setting this to 1 will display a number by every line. Setting this to 2 will display a number by every 2nd line, etc. |
|
Sets or returns a boolean that represents whether or not Word will draw vertical lines between columns. |
|
Sets or returns an int that represents the number of columns in this section. |
|
Sets or returns an int that represents the page height for this section in twips. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a Section.NumberFormat object that represents the page number format for this section. There are 5 type of page number formats: | |
Sets or returns a Section.Orientation object that represents the page orientation for this section. Possible values: Portrait, Landscape, Mixed | |
Sets or returns the size of printed pages. | |
Sets or returns an int that represents the page width for this section in twips. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a boolean that represents whether or not page numbering will restart at the beginning of this section. |
|
Sets or returns an int that represents the horizontal distance of the right margin from the right edge of the page for this section. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns an int that represents the vertical distance of the top margin from the top edge of the page for this section. One twip = (1/20 pt) or (1/1440 in) |
|
Sets or returns a boolean that represents whether or not this section is unlocked. |
Methods
Name |
Description |
---|---|
Returns a Border object that represents the border of this section at the specified location. You can use the returned object to manipulate the borders for this section. Valid locations: Top, Left, Bottom, Right | |
Returns an Element object that represents the footer of the specified type for this section. The footer is returned as a editable element. There are 4 types of footers: | |
Returns an Element object that represents the header of the specified type for this section. The header is returned as a editable element. There are 4 types of headers: |
Nested Classes
Name |
Description |
---|---|
Areas that a border can be applied to for a section. | |
Types of breaks that can preceed a section. | |
Types of headers and footers. | |
Line numbering settings for a section. | |
Formats for page numbers in a section. | |
Page orientations for a section. | |
Page paper sizes that can be applied to a section. All native sizes are supported, and additional sizes are provided |