Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Reference
 Sections Property (2007 System)

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio Tools for Office API Reference
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)
Visual Basic (Declaration)
<BrowsableAttribute(False)> _
Public ReadOnly Property Sections As Sections
Visual Basic (Usage)
Dim instance As Document
Dim value As Sections

value = instance.Sections
C#
[BrowsableAttribute(false)]
public Sections Sections { get; }

Property Value

Type: Microsoft.Office.Interop.Word..::.Sections
A Sections collection that represents the sections in the document.

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.

Visual Basic
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 

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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker