Udostępnij za pośrednictwem


DocumentBase.HTMLDivisions Property

Gets an HTMLDivisions object that represents an HTML division in a Web document.

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

Syntax

'Declaration
Public ReadOnly Property HTMLDivisions As HTMLDivisions
    Get
public HTMLDivisions HTMLDivisions { get; }

Property Value

Type: Microsoft.Office.Interop.Word.HTMLDivisions
An HTMLDivisions object that represents an HTML division in a Web document.

Examples

The following code example adds an HTMLDivisions to the document and then displays a message that shows the total number of HTMLDivisions in the document. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub DocumentHTMLDivisions()
    Dim divisionRange As Object = Me.Paragraphs(1).Range
    Me.HTMLDivisions.Add(divisionRange)
    MessageBox.Show("Total HTML Divisions: " & Me.HTMLDivisions.Count.ToString())
End Sub
private void DocumentHTMLDivisions()
{
    object divisionRange = this.Paragraphs[1].Range;
    this.HTMLDivisions.Add(ref divisionRange);
    MessageBox.Show ("Total HTML Divisions: " + 
        this.HTMLDivisions.Count.ToString());
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace