DocumentBase.Sections Propriedade

Definição

Obtém uma coleção Sections que representa as seções no documento.

public Microsoft.Office.Interop.Word.Sections Sections { get; }

Valor da propriedade

Sections

Uma coleção Sections que representa as seções no documento.

Exemplos

O exemplo de código a seguir adiciona texto ao primeiro parágrafo no documento e, em seguida, adiciona uma nova seção antes do texto. Para usar esse exemplo, execute-o na classe ThisDocument em um projeto no nível de documento.

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

Aplica-se a