Page 1 of 1

How to get Mergefield

PostPosted: Tue Dec 13, 2011 6:53 am
by priyank
How i will get all mergefield values present in a document. I am new to docx4j...

Re: How to get Mergefield

PostPosted: Tue Dec 13, 2011 9:21 am
by jason
See http://www.docx4java.org/svn/docx4j/tru ... el/fields/ in trunk tip for some code and commentary.

Note this is currently work in progress; and the objective of that code is to be able to replace the values, not get them. But it may give you a start.

Re: How to get Mergefield

PostPosted: Fri Dec 16, 2011 3:19 am
by priyank
Thank you for your quick reply and for some useful information..
How i can extend the FieldEditor.java to identify the start and end of table raws in sequeence and if any mergefield field is there in raws i should able to traverse in document order...

Thank you..

Re: How to get Mergefield

PostPosted: Fri Dec 16, 2011 9:33 am
by jason
What is FieldEditor.java? Do you mean FieldLocator?

By "table raws", do you mean rows?

FieldLocator should find fields in table cells. If this is not what you want or is not working properly, please post example table xml, and explain your requirement more clearly.

cheers .. Jason