Expand Minimize

Bookmark.Comments Property

Gets a Comments collection that represents all the comments in the Bookmark control.

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

Comments Comments { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Comments
A Comments collection that represents all the comments in the Bookmark control.

The following code example adds a Bookmark control with text to the document, and then inserts a comment into the bookmark.

This example is for a document-level customization.

private void BookmarkComments()
{
    object commentText = "This is sample comment text.";
    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.";
    bookmark1.Comments.Add(bookmark1.Range, ref commentText);
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft