Page 1 of 1

authoring data binding of content controls

PostPosted: Wed May 22, 2013 2:42 am
by raylapse
Hi Jason,

I am new to Docx4j but already read some posts from you.
I learned the best way to do content replacement from a template is the content control binding approach, right?
However I am wondering is it a must to install the opendope add-ins before I start?
Is it possible to use microsoft word to author the same thing(without coding)?

My case is I am developing a tool to replace some text and hyperlinks from a template. And the template is authored by guys without any coding experience. So I would expect they can use word without installing any other things.

Another questions is, does word 2003 support content controls and bindings? What happens if I convert a docx file(2007 or above) which contains content controls and xml data to 2003 format?

Best Regards, Daniel

Re: authoring data binding of content controls

PostPosted: Wed May 22, 2013 7:48 am
by jason
Yeah, you need the authoring add-in installed if you want to add repeats and conditions.

Even if you don't want those ie you just want plain vanilla data binding, you need some kind of tool to set up the XPath expressions.

Alternative approaches:
- you could possibly use VBA macros embedded in a template document, but I don't have anything like this to offer you right now
- you could use magic text strings on the surface of the document, which are then converted later server-side into data bound content controls. There is code in docx4j like this, at https://github.com/plutext/docx4j/tree/ ... /migration

Word 2003 doesn't support content controls and data binding. If i recall correctly, the controls will be dropped when you convert to 2003 format. Which is now 10 years old!!

Re: authoring data binding of content controls

PostPosted: Wed May 22, 2013 1:42 pm
by raylapse
Hi Jason,

Thanks for the quick answer. It helps me a lot.
btw: Hope the new 3.0.0 version will come out soon! I look the source code and found a lot of new features there comparing to 2.8.1 version :D Good Job!

Best Regards,
Daniel