CommentCollection Class

Provides typed access to a collection of Comment nodes.
Inheritance Hierarchy

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public class CommentCollection : NodeCollection

The CommentCollection type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleCount
Gets the number of nodes in the collection.
(Inherited from NodeCollection.)
Public propertyCode exampleItem
Retrieves a Comment at the given index.
Methods
  NameDescription
Public methodCode exampleAdd
Adds a node to the end of the collection.
(Inherited from NodeCollection.)
Public methodCode exampleClear
Removes all nodes from this collection and from the document.
(Inherited from NodeCollection.)
Public methodCode exampleContains
Determines whether a node is in the collection.
(Inherited from NodeCollection.)
Public methodEquals (Inherited from Object.)
Public methodGetEnumerator (Inherited from NodeCollection.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodCode exampleIndexOf
Returns the zero-based index of the specified node.
(Inherited from NodeCollection.)
Public methodCode exampleInsert
Inserts a node into the collection at the specified index.
(Inherited from NodeCollection.)
Public methodCode exampleRemove
Removes the node from the collection and from the document.
(Inherited from NodeCollection.)
Public methodCode exampleRemoveAt
Removes the node at the specified index from the collection and from the document.
(Inherited from NodeCollection.)
Public methodCode exampleToArray
Copies all nodes from the collection to a new array of nodes.
(Inherited from NodeCollection.)
Public methodToString (Inherited from Object.)
Examples
Shows how to mark comment as Done.
Document doc = new Document(MyDir + "Comments.docx");

NodeCollection comments = doc.GetChildNodes(NodeType.Comment, true);

Comment comment = (Comment) comments[0];
CommentCollection repliesCollection = comment.Replies;

foreach (Comment childComment in repliesCollection)
{
    if (!childComment.Done)
    {
        // Update comment reply Done mark
        childComment.Done = true;
    }
}
See Also