Page 1 of 1

Opendope does not allow carriage return?

PostPosted: Thu Oct 13, 2011 6:18 pm
by Ron
I am generating a word document by mapping xml file.

I am using opendope word add in to bind the content controls.

However,I am not able to edit the generated word document because the content is surrounded by content control. Word does not allow simple editing on content controls.

I actually have to remove content control from generated document and then edit the text. Its really a pain to delete each and every content control before editing the text.

Is there any better solution or workaround for this?

Thanks for help.

Re: Opendope does not allow carriage return?

PostPosted: Wed Oct 19, 2011 12:47 am
by jason
Hi Ron

Word does not let you bind a rich text control, only a plain text one.

A plain text one can contain multiple lines of text. Enter the content control, then on Word's developer tab, choose properties, then under "plan text properties", check "allow carriage returns (multiple paragraphs)"

You should be able to change the text contents of the content control, and Word should reflect these changes back in your CustomXML part (if it is a normal word databinding).

In short, you shouldn't need to delete the content controls. (But if you find that is necessary, recent docx4j can do that for you:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
                RemovalHandler rh = new RemovalHandler();
                rh.removeSDTs(wordMLPackage, Quantifier.ALL);
 
Parsed in 0.013 seconds, using GeSHi 1.0.8.4

)

Re: Opendope does not allow carriage return?

PostPosted: Thu Oct 20, 2011 3:40 pm
by Ron
Hi Jason,

Thanks for the response.

I am using docx4j-2.7.0-rc2 version.

The removeSTDs method has different signature in this version.

Does the java code mentioned in your comment available in some other release?

Would you please let me know what release is that?

Thanks
Ron

Re: Opendope does not allow carriage return?

PostPosted: Tue Oct 25, 2011 9:32 am
by jason
I'd suggest you try 2.7.1 (which has been available for 10 days now, but which I haven't yet had a chance to write the release announcement for) - see http://www.docx4java.org/docx4j/