@@ -0,0 +1,1050 @@
+package com.aspose.words.examples.programming_documents.comments;%0A%0Aimport com.aspose.words.*;%0Aimport com.aspose.words.examples.Utils;%0A%0A@SuppressWarnings(%22unchecked%22)%0Apublic class RemoveCommentRegionText %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A%0A        // The path to the documents directory.%0A        String dataDir = Utils.getDataDir(RemoveCommentRegionText.class);%0A%0A        // Open the document.%0A        Document doc = new Document(dataDir + %22TestFile.doc%22);%0A%09%09CommentRangeStart commentStart = (CommentRangeStart)doc.getChild(NodeType.COMMENT_RANGE_START, 0, true);%0A%09%09CommentRangeEnd commentEnd = (CommentRangeEnd)doc.getChild(NodeType.COMMENT_RANGE_END, 0, true);%0A%0A%09%09Node currentNode = commentStart;%0A%09%09Boolean isRemoving = true;%0A%09%09while (currentNode != null && isRemoving)%0A%09%09%7B%0A%09%09%09if (currentNode.getNodeType() == NodeType.COMMENT_RANGE_END)%0A%09%09%09%09isRemoving = false;%0A%0A%09%09%09Node nextNode = currentNode.nextPreOrder(doc);%0A%09%09%09currentNode.remove();%0A%09%09%09currentNode = nextNode;%0A%09%09%7D%0A %0A        doc.save(dataDir + %22output.doc%22);%0A%0A    %7D%0A%7D

Remove text between CommentRangeStart and CommentRangeEnd