This documentation is archived and is not being maintained.

Bookmark.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 (in microsoft.office.tools.word.dll)

public HTMLDivisions HTMLDivisions { get; }

Property Value

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

The following code example adds a Bookmark control with text to the first paragraph and then adds an HTMLDivisions object to the bookmark and displays the total number of HTML divisions in the bookmark in a message box.

private void BookmarkHTMLDivisions()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    object division = Paragraphs[1].Range;
    bookmark1.HTMLDivisions.Add(ref division);
    MessageBox.Show("Number of HTMLDivisions in bookmark1 :" 
        + bookmark1.HTMLDivisions.Count.ToString());
}

Show: