fn = "企业信用报告专业版-20220722180143(1).docx" fn_new = "_new".join(splitext(fn)) word = Document(fn) delete_docx_prefix_description(word) # 取消“奇偶页不同”, 对整个文档有效 word.settings.odd_and_even_pages_header_footer = False for section in word.sections: # 取消“首页不同”、 对每一节分别设置 section.different_first_page_header_footer = False # 删除页眉页脚 section.header.is_linked_to_previous = True section.footer.is_linked_to_previous = True word.save(fn_new) startfile(fn_new)
python处理docx
最新推荐文章于 2023-10-26 17:14:25 发布