CommentReplies Property
Returns a collection of Comment objects that are immediate children of the specified comment.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public CommentCollection Replies { get; }

Property Value

Type: CommentCollection
Shows how to get all comments with all replies.
Document doc = new Document(MyDir + "Comment.Document.docx");

// Get all comment from the document
NodeCollection comments = doc.GetChildNodes(NodeType.Comment, true);

// For all comments and replies we identify comment level and info about it
foreach (Comment comment in comments.OfType<Comment>())
    if (comment.Ancestor == null)
        Console.WriteLine("This is a top-level comment\n");

        Console.WriteLine("Comment author: " + comment.Author);
        Console.WriteLine("Comment text: " + comment.GetText());

        foreach (Comment commentReply in comment.Replies.OfType<Comment>())
            Console.WriteLine("This is a comment reply\n");

            Console.WriteLine("Comment author: " + commentReply.Author);
            Console.WriteLine("Comment text: " + commentReply.GetText());
See Also