Reputation: 11
from docx import Document
d = Document('/tmp/doc_with_header.docx')
d.sections[0].headers[0].add_paragraph(text='moar header')
d.save('/tmp/moar_headers.docx')
this is the code here is the error
AttributeError: 'Section' object has no attribute 'header'
Upvotes: 1
Views: 1281
Reputation: 658
Looks like, you've got this solution from this page, yeah? Unfortunately, it's not the actual documentation, but only API suggestion, for further implementation. Just promises and nothing more at the moment=\
Upvotes: 1