Message-ID: <1264622396.8161.1711634819091.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8160_1893290285.1711634819091" ------=_Part_8160_1893290285.1711634819091 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Section

Section

Description

=20

This class is used to represent a section of the document. Many document= s will only contain one section. More complex documents will divide the doc= ument into multiple sections. A section can be roughly correlated to a chap= ter in a book. Each section can have different formatting settings, includi= ng:

=20
C#
=20
 public sealed class Section : Element
=20
=20
vb.net
=20
Public NotInheritable Class Section
=09=09Inherits Element
=20
=20

Remarks

=20

To create a new section, use Element.CreateSectionBefore().

=20

To get an existing section, use Document.Sections.

=20

The following sample shows you how to get the add a new section to a doc= ument and how to get the first section of a document.

=20

Examples

=20
C#
=20

          //--- Add a new section to a document
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Open(@"C:\sample.doc");
          Section sect =3D doc.CreateSectionAfter();

          //--- Get the first section of a document
          WordApplication app =3D new WordApplication();
          Document doc =3D app.Open(@"C:\sample.doc");
          Section sec1 =3D doc.Sections[0];
        
=20
=20
vb.net
=20

          '--- Add a new section to a document
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Open("C:\sample.doc")
          Dim sect As Section =3D doc.CreateSectionAfter()

          '--- Get the first section of a document
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Open("C:\sample.doc")
          Dim sect As Section =3D doc.Sections(0)
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 = =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

BorderAlwaysInFront

Sets or returns a boolean that repr= esents whether or not page borders for this section will always display in = front of any objects it may overlap.

BorderAppliedTo

Sets or returns a BorderArea object that represents where the page border w= ill be applied to.

BorderOffsetsFromPage

Sets or returns a boolean that repr= esents whether or not the padding for this section's page border will be me= asured from the edge of the page or from the text it surrounds.

BottomMargin

Sets or returns an int that represe= nts the vertical distance of the bottom margin from the bottom edge of the = page for this section. One twip =3D (1/20 pt) or (1/1440 in)

Break<= /a>

Sets or returns a Section.BreakType object that represents the type of break= (before) this section. There are 5 types of breaks: Continuous, Column, Pa= ge, EvenPage, and OddPage.

FirstLineNum

Sets or returns an int that represe= nts the number that the line numbering starts at for this section.

FirstPageNum

Sets or returns an int that represe= nts the number that the page numbering starts at for this section.

Foot= erY

Sets or returns an int that represe= nts the y coordinate of the footer measured from the top edge of the page. = One twip =3D (1/20 pt) or (1/1440 in)

= GutterWidth

Sets or returns an int that represe= nts 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 bindi= ng. One twip =3D (1/20 pt) or (1/1440 in)

HasTitlePage

Sets or returns a boolean that repr= esents whether or not this section has a title page. This can affect page n= umbering and the appearance of headers and footers.

Head= erY

Sets or returns an int that represe= nts the y coordinate of the header measured from the top edge of the page. = One twip =3D (1/20 pt) or (1/1440 in)

L= eftMargin

Sets or returns an int that represe= nts the horizontal distance of the left margin from the left edge of the pa= ge for this section. One twip =3D (1/20 pt) or (1/1440 in)

LineNumberingType

Sets or returns a Section.LineNumbering object that represents the line = numbering restart policy for this section. There are 3 options:

= LineNumberX

Sets or returns an int that represe= nts the x position of line numbers in twips. One twip =3D (1/20 pt) or ( 1/= 1440 in)

LineNumModulus

Sets or returns an int that represe= nts the line numbering modulus. This setting is used to set whether line nu= mbers 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 ev= ery line. Setting this to 2 will display a number by every 2nd line, etc.=20

LinesBetween

Sets or returns a boolean that repr= esents whether or not Word will draw vertical lines between columns.

N= umColumns

Sets or returns an int that represe= nts the number of columns in this section.

P= ageHeight

Sets or returns an int that represe= nts the page height for this section in twips. One twip =3D (1/20 pt) or (1= /1440 in)

PageNumberFormat

Sets or returns a Section.NumberFormat object that represents the page nu= mber format for this section. There are 5 type of page number formats:

PageOrientation

Sets or returns a Section.Orientation object that represents the page orie= ntation for this section. Possible values: Portrait, Landscape, Mixed

Pag= eSize

Sets or returns the size of printed pages.

Pa= geWidth

Sets or returns an int that represe= nts the page width for this section in twips. One twip =3D (1/20 pt) or (1/= 1440 in)

RestartPageNum

Sets or returns a boolean that repr= esents whether or not page numbering will restart at the beginning of this = section.

= RightMargin

Sets or returns an int that represe= nts the horizontal distance of the right margin from the right edge of the = page for this section. One twip =3D (1/20 pt) or (1/1440 in)

To= pMargin

Sets or returns an int that represe= nts the vertical distance of the top margin from the top edge of the page f= or this section. One twip =3D (1/20 pt) or (1/1440 in)

Unl= ocked

Sets or returns a boolean that repr= esents whether or not this section is unlocked.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

GetBorder(Border.Location)

Returns a Border= object that represents the border of this section at the specified loc= ation. You can use the returned object to manipulate the borders for this s= ection. Valid locations: Top, Left, Bottom, Right

GetFooter(Section.HeaderFooterType)

Returns an Elem= ent object that represents the footer of the specified type for this se= ction. The footer is returned as a editable element. There are 4 types of f= ooters:

GetHeader(Section.HeaderFooterType)

Returns an Elem= ent object that represents the header of the specified type for this se= ction. The header is returned as a editable element. There are 4 types of h= eaders:
=20

Nested Classes

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20

Name

Description

B= orderArea

Areas that a border can be applied to for a sect= ion.

Br= eakType

Types of breaks that can preceed a section.

HeaderFooterType

Types of headers and footers.

LineNumbering

Line numbering settings for a section.

NumberFormat

Formats for page numbers in a section.

= Orientation

Page orientations for a section.

PagePaperSize

Page paper sizes that can be applied to a sectio= n. All native sizes are supported, and additional sizes are provided
------=_Part_8160_1893290285.1711634819091--