from  docx  import  Document
from  docx.shared  import  Cm
文件=Document(r'E:\word训练\页眉页脚.docx')
第一节=文件.sections[0]
print("上面距:",第一节.top_margin.cm)
print("下面距:",第一节.bottom_margin.cm)
print("左侧距:",第一节.left_margin.cm)
print("右侧距:",第一节.right_margin.cm)

#设定网页页面行高
第一节.top_margin=Cm(5)
第一节.bottom_margin=Cm(5)
第一节.left_margin=Cm(4)
第一节.right_margin=Cm(4)

文件.save(r'E:\word训练\设定页边距.docx')

 

文章来源于网络,如有侵权请联系站长QQ61910465删除
本文版权归去快排Seo www.SEOgurublog.com 所有,如有转发请注明来出,竞价开户托管,seo优化请联系QQ▷61910465