Free Support Forum - aspose.com

Issue in reading content between the bookmark(ASPOSE.WORDS for JAVA)

We have to read the content between two bookmarks, namely webpubOverview1 and webpubOverview2. The two bookmarks does not belong to the same parent node. So we are not able to parse through the nodes between webpubOverview1 and webpubOverview2 and read the content. The following is the piece of code we tried

Bookmark bookmarkStart = bookmarkColl.get("webpubOverview1");

Bookmark bookmarkEnd = bookmarkColl.get("webpubOverview2.");

Node childNode = startBookmark.getBookmarkEnd();

Node endNode = endBookmark.getBookmarkStart();

while (childNode != null && childNode != endNode) {

if(childNode is composite)

{parse though child nodes and read content

}

else

childNode.getText();

childNode = startNode.getNextSibling();

}

Regards

Deepak

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I think you can find an answer in the following thread:

http://www.aspose.com/community/forums/thread/150972/extracting-formatted-content-between-two-bookmarks-and-saving-it-in-a-new-word-document.aspx

Please let me know in case of any issues, I will be glad to help you.

Best regards.