Sdílet prostřednictvím


DocumentBase.Sections – vlastnost

Získává Sections kolekce představuje oddíly v dokumentu.

Obor názvů:  Microsoft.Office.Tools.Word
Sestavení:  Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Deklarace
Public ReadOnly Property Sections As Sections
    Get
public Sections Sections { get; }

Hodnota vlastnosti

Typ: Microsoft.Office.Interop.Word.Sections
A Sections kolekce představuje oddíly v dokumentu.

Příklady

Následující příklad kódu přidá text prvního odstavce v dokumentu a potom přidá novou sekci před text. Chcete-li použít tento příklad spustit z ThisDocument třídy v projektu úrovni dokumentu.

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);
}

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

DocumentBase Třída

Microsoft.Office.Tools.Word – obor názvů