Share via


Document.Sections Property (2007 System)

Gets a Sections collection that represents the sections in the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Sections As Sections
'Usage
Dim instance As Document 
Dim value As Sections 

value = instance.Sections
[BrowsableAttribute(false)]
public Sections Sections { get; }
[BrowsableAttribute(false)]
public:
property Sections^ Sections {
    Sections^ get ();
}
public function get Sections () : Sections

Property Value

Type: Sections
A Sections collection that represents the sections in the document.

Examples

The following code example adds text to the first paragraph in the document and then adds a new section before the text.

This example is for a document-level customization.

Private Sub DocumentSections()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "This is sample text." 
    Dim Range As Object = Me.Paragraphs(1).Range

    Me.Sections.Add(Range)
End Sub
private void DocumentSections()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This is sample text.";
    object Range = this.Paragraphs[1].Range;

    this.Sections.Add(ref Range, ref missing);
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace