Open fatune opened 7 years ago
Same here. I have a document collection that I need to extract a certain part of. So far I'm relying on the fact that the delimiters are known strings, so I can use an appropriate slice and insert new paragraphs containing the text of the paragraphs in my slice. However, this misses things like e.g. tables, and of course, all the formatting.
Same. If this already exists, I cannot find a way to add contents of one docx into another. I believe several solutions exist to get the text out of one docx, but as far as I can tell, not add it to another document specific space (like a run).
I can easily modify text of paragraph marked with %main% by using docx with following code.
''' for paragraph in document.paragraphs: if '%main%' in paragraph.text: paragraph.text = 'new text' '''
However, I would like to inject another piece of formatted docx into this place. Ideally with multiple paragraphs, tables, images, headers and other styles.