How to remove special characters and STYLEREF text?

I have the following text in word “Figure 1-1: Concept of ABC”. However when I do the node.getText() on this node, it gets parsed as "Figure STYLEREF 1 \s 1- SEQ Figure * ARABIC \s 1 1: Concept of ABC".

How can I avoid added STYLEREF and special characters ? I want it to parse as "Figure 1-1: Concept of (13.2 KB)
" only.


Thanks for your inquiry. Please use Node.toString(SaveFormat.TEXT) method to get the desired output.

Document doc = new Document(MyDir + "Sample.docx");

That solved my problem. Thank you for your prompt reply.