remove_all_replies method

remove_all_replies()

Removes all replies to this comment.

def remove_all_replies(self):
    ...

Remarks

All constituent nodes of the replies will be deleted from the document.

Examples

Shows how to remove comment replies.

doc = aw.Document()

comment = aw.Comment(doc, "John Doe", "J.D.", datetime.now())
comment.set_text("My comment.")

doc.first_section.body.first_paragraph.append_child(comment)

comment.add_reply("Joe Bloggs", "J.B.", datetime.now(), "New reply")
comment.add_reply("Joe Bloggs", "J.B.", datetime.now(), "Another reply")

self.assertEqual(2, comment.replies.count)

# Below are two ways of removing replies from a comment.
# 1 -  Use the "remove_reply" method to remove replies from a comment individually:
comment.remove_reply(comment.replies[0])

self.assertEqual(1, comment.replies.count)

# 2 -  Use the "remove_all_replies" method to remove all replies from a comment at once:
comment.remove_all_replies()

self.assertEqual(0, comment.replies.count)

See Also