Re: Merge Word docx into another Word dox via XWPFDocument - preserving formatting

2016-08-08 Thread Алексей Ушаровский
Hello! I've tackled with this problem few weeks ago. And my solution is in using AltChunk element of OOXML format. It's already works but there is one problem for which I have no simple solution. The problem is conflicts between styles of documents we try to merge. Here is my topic about addin

RE: Merge Word docx into another Word dox via XWPFDocument - preserving formatting

2016-08-08 Thread Murphy, Mark
That depends on what you mean by merge. Are you just trying to append document B onto the end of Document A, or are you trying to mix them together in some specific way? Appending should be just a matter of reading through the document body of Document B, and copying the elements to Document A.

Re: Merge Word docx into another Word dox via XWPFDocument - preserving formatting

2016-08-08 Thread Cory Newey
Thanks for the replies. Unfortunately, I don't just want to tack one document onto the end of another document. I want to search for a particular word/phrase in the first document and replace that with the entire contents of the second document. That means that if I find the text to be replaced in

Re: Merge Word docx into another Word dox via XWPFDocument - preserving formatting

2016-08-08 Thread Angelo zerr
Hi Cory, It seems that you wish benefit with "mail merge" features. I suggest you that you try XDocReport which provides the capability to create a template docx with MS Word and use Velocity/Freemarker syntax to manage fields

RE: Merge Word docx into another Word dox via XWPFDocument - preserving formatting

2016-08-08 Thread Murphy, Mark
So what you need to do is end the run (and paragraph, and potentially table, row, and cell) then start inserting the new document, then reopen the table/paragraph/run with the original properties. You still have to be concerned with sections though because "Document B" will likely contain a sec

Re: Merge Word docx into another Word dox via XWPFDocument - preserving formatting

2016-08-08 Thread Dominik Stadler
You can also take a look at https://github.com/centic9/poi-mail-merge, it uses a very simple replacement-mechanism to fill in contents from an xlsx/csv to create multiple merged documents. Will it is not a complete fit, you might be able to adjust it for your use-case. Dominik On Aug 8, 2016 5:4