Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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:
© 2015 Microsoft