Page 1 of 1

Replace Content Controls with text

PostPosted: Mon Jun 20, 2016 10:31 am
by roytmana@gmail.com
Hi I am pretty new to WordML and docx4j. I need to do a pretty common thing inject data into word documents before delivering them to the users. I like concept of data bound content controls but I do not want them to be retained in the final (delivered) document but rather just textual (formatted) content based on the injected data (setting content controls to be read/only is not acceptable - the documents will be editorialized after generation).
Is there any way to do it with docx4j or MS word itself (like calling some method to convert controls to text)

Re: Replace Content Controls with text

PostPosted: Mon Jun 20, 2016 9:22 pm
by jason
Have a look at https://github.com/plutext/docx4j/blob/ ... .java#L382

Flag FLAG_BIND_REMOVE_SDT will remove the content controls.

Re: Replace Content Controls with text

PostPosted: Tue Jun 21, 2016 6:35 am
by roytmana@gmail.com
Many thanks Jason, I will look at it