I want to copy paragraphs in word to table, that paragraphs containing line break ,color, list bullet and started with keyword as shown in the image below tried with bellow code but I didn’t get all lines
from copy import deepcopy
from docx import Document
def copy_table_after(table, paragraph):
tbl, p = table._tbl, paragraph._p
new_tbl = deepcopy(tbl)
p.addnext(new_tbl)
for paragraph in doc.paragraphs:
if "paragraph" in paragraph.text:
copy_table_after(table, paragraph)
do you have any idea how i can do that ?
Thanks in advance