I have a document created with Word 2002 SP3.
This document have some MergeFields (FieldStart, RunNode, FieldSeparator, RunNode, FieldEnd).
I travel node by node and when i find a FieldStart node y catch the second RunNode.
This RunNode have the name of the MergeField.
But sometimes i have only ‘<<’, i don’t have ‘<>’.
Thanks for your inquiry. This occurs, because field value (displayed text) can consist of few Run nodes. You can inspect structure of Word document using DocumentExplorer (Aspose.Words demo application).
So, to get field value it is not enough to just get the text of the next Run after FieldSeparator node. You should get text of all Run nodes between FieldSeparator and FieldEnd nodes.
Please let me know if you need more assistance, I will be glad to help you.
Best regards,
Thanks for your request. Please put the following jars in one directory:
Aspose.Words.DocumentExplorer.jar
itext-1.4.2.jar
testng-5.6-jdk15.jar
Aspose.Words.jdk15.jar
And use the following command to run DocumentExplorer:
java -classpath “Aspose.Words.DocumentExplorer.jar;Aspose.Words.jdk15.jar;itext-1.4.2.jar;testng-5.6-jdk15.jar” com.aspose.words.documentexplorer.MainForm
Hope this helps.
Best regards,