Expand Minimize

DocumentBase.Comments Property

Gets a Comments collection that represents all the comments in the document.

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

public Comments Comments { get; }

Property Value

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

The following code example adds text to the first paragraph and then adds a comment to the second word in the paragraph. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentComments()
{
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Paragraphs[1].Range.Text = "This is sample Text";
    object commentText = "This is comment text";
    this.Comments.Add(this.Paragraphs[1].Range.Words[2], ref commentText);
}

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