Skip to content

Read all footers from docx. file #868

@Gilad77711

Description

@Gilad77711

Hello,
I read that reading footers and headers is available in the latest version of python-docx (https://python-docx.readthedocs.io/en/latest/user/hdrftr.html).

However, when I implement the code below on the attached file (71M6543F-71M6543H.docx
, I get only blanks:

from docx import Document

Reading all footers datasheet:

data_sheet = "D:\CADY\R_D\TestModules\PageNumbers\71M6543F-71M6543H.docx"
word_doc = Document(data_sheet)

for section in word_doc.sections:

footer = section.footer
for paragraph in footer.paragraphs:
    
    print(paragraph.text)

Could you please let me know how to fix this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions