Merge multiple word documents?
See original GitHub issueI’ve been playing around with this package to see if it’s possible to combine multiple word documents with a simple script. It seems like it should be possible given the objects, but I can’t find an intuitive way to do this.
Basically, I have a folder with .docx
files like 01.docx
, 02.docx
, 03.docx
etc. I’d just like to join these together in a single document as if I had “copy/pasted” each one in succession.
I’ve tried appending the paragraphs
attribute of one to another, but this doesn’t seem to work, and add_paragraph
only accepts a string, not a Paragraph
object. Any idea on the best way to accomplish this?
ps: if this works then I am eternally grateful…this is a pretty nice package for people who are writing a dissertation, but whos advisor won’t let them use Latex 😉
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (2 by maintainers)
I created a fork of python-docx that provides easy access to images when r eading a DOCx file. It might help you figure out what you need. https://github.com/DKWoods/python-docx
@xlhu19 It works actually, but header and footer has gone in the doc1 or doc2,
I would recommend
that would be useful In case doc1 or doc2 has the same template