Answer the question
In order to leave comments, you need to log in
How to copy a python docx table?
Good evening. Interested in the question: how to copy a table from a sheet to another sheet?
I have ex.dox file. It has 1 sheet and there is a table (in the entire sheet).
You need to create a new one (or just paste it in the last sheet, as it should be transferred to the new sheet automatically), which is an absolute copy of the first one.
Here is the code, instead of "..." should be something, probably.
import docx
from docx.shared import Pt
import os.path
document = docx.Document('ex.docx')
document.add_page_break()
...
document.save('ex2.docx')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question