How to: Add Comments to Text in Documents
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

How to: Add Comments to Text in Documents

NoteNote

Some code examples in this topic use the this or Me keyword or the Globals class in a way that is specific to document-level customizations, or they rely on features of document-level customizations such as host controls. These examples can be compiled only if you have the required applications installed. For more information, see Features Available by Product Combination.

Use the Comments property of the Microsoft.Office.Tools.Word.Document to add a comment to a range of text within a Microsoft Office Word 2003 document.

The following example adds a comment to the first paragraph in the document.

To add a new comment to text

  • Call the Add method of the Comments property and supply a range and the comment text.

    object text = "Add a comment to the first paragraph.";
    this.Comments.Add(this.Paragraphs[1].Range, ref text);
    
    

See Also

Show:
© 2016 Microsoft