Section Object

Description

Represents a single section in a selection, range, or document. The Section object is a member of the Sections collection. The Sections collection includes all the sections in a selection, range, or document.

Using the Section Object

Use Sections(index), where index is the index number, to return a single Section object. The following example changes the left and right page margins for the first section in the active document.

With ActiveDocument.Sections(1).PageSetup
    .LeftMargin = InchesToPoints(0.5)
    .RightMargin = InchesToPoints(0.5)
End With
Use the Add method or the InsertBreak method to add a new section to a document. The following example adds a new section at the beginning of the active document.

Set myRange = ActiveDocument.Range(Start:=0, End:=0)
ActiveDocument.Sections.Add Range:=myRange
myRange.InsertParagraphAfter
The following example adds a section break above the first paragraph in the selection.

Selection.Paragraphs(1).Range.InsertBreak Type:=wdSectionBreakContinuous
Note The Headers and Footers properties of the specified Section object return a HeadersFooters object.

Properties

Application property, Borders property, Creator property, Footers property, Headers property, Index property, PageSetup property, Parent property, ProtectedForForms property, Range property.