Hi Aspose-support team,
at the moment I am working on a cross reference table.
But I do need all reference “header” styles.
In Word, if you click “cross reference” -> “heading” then you can get all headers of the document.
I tried the following code, but it looks like not all reference are included:
Attached you can find the screenshot of the MS Word function I am talking about.
Thank you.
NodeCollection<Paragraph> nodes = doc.getChildNodes(NodeType.PARAGRAPH, true);
for (Paragraph child : (Iterable<Paragraph>) nodes) {
BookmarkCollection bookmarks = child.getRange().getBookmarks();
for (Bookmark bookmark : bookmarks) {
System.out.println("++" + bookmark.getName() + " = " + bookmark.getText().replaceAll("\\r", ""));
}
}
Thank You very much.
image.png (25.6 KB)