def add_para_data(output_doc_name, paragraph): """ Write the run to the new file and then set its font, bold, alignment, color etc. data. """ output_para = output_doc_name.add_paragraph() for run in paragraph.runs: # output_run = output_para.add_run(run.text) output_run = output_para.add_run() # Run's bold data output_run.bold = run.bold # Run's italic data output_run.italic = run.italic # Run's underline data output_run.underline = run.underline # Run's color data output_run.font.color.rgb = run.font.color.rgb # Run's font data output_run.font.name = run.font.name output_run.font.highlight_color = run.font.highlight_color output_run.font.size = run.font.size # output_run.style.name = run.style.name output_run.style = run.style # Paragraph's alignment data output_para.style = paragraph.style output_para.alignment = paragraph.alignment output_para.paragraph_format.alignment = paragraph.paragraph_format.alignment output_para.paragraph_format.widow_control = paragraph.paragraph_format.widow_control
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)