I am trying to set text/images to content controls in a docx. BindingHandler.applyBindings seems to apply the bindings to the main doc part. I can see the value being changed on debug. But when I save it using WordprocessingMLPackage.save or Docx4J.save, I dont see the newly bound text/image in the output document. What could possibly be the reason?
Asked
Active
Viewed 918 times
1
-
1Are you looking at the output document in Word, or by unzipping it? Sorry to ask the obvious, but are you sure you are really looking at the output docx, not the input or something else? – JasonPlutext Apr 04 '14 at 20:29
-
I wish I was looking at something else. :( Unfortunately I am looking at the right output document and it doesnt have the bound values. – Artin Apr 04 '14 at 21:10
-
Are you looking at the output document in Word, or by unzipping it? I don't know what your code is doing exactly, but I guess it is possible you have the original XML part in your docx, and Word is updating the docx by re-binding those original values. That's why it would be better to unzip and examine the raw XML. – JasonPlutext Apr 07 '14 at 08:39
-
Yes, unzipping the output docx made a lot of things clear. Wish I had done it earlier. Lesson learnt! Raised another question. POsted here. http://stackoverflow.com/questions/22915683/content-control-toolkit-creates-extra-custom-xml-parts-on-reopen-docx – Artin Apr 07 '14 at 14:46