Let me make it clear that I am able to access and edit(color highlight) the footers ("Footer Section xx") but not some footers, which are named as "First Page Footer - Section xx" (The Footer Section vs First Page Footer - Section are distinguish in the screenshot below).
The examples of footers that I am able to highlight:
The example of footers that I am unable to highlight. And these footers are not only on page 1 but throughout the document:
I believe these "First Page Footer Section" are the isolated footers when the option "Different 1st page footer" is selected in the Word Footer option. The question is how do I access and then ultimately highlight these "First Page Footer Section"?
The python code that I used which did highlight "Footer Section" (but couldn't highlight "First Page Footer Section") is:
filepath = r'c:\temp\doc_input_file.docx'
doc1 = docx.Document( filepath )
for section in doc1.sections:
for p in section.footer.paragraphs:
for e_run in p.runs:
e_run.font.highlight_color = WD_COLOR_INDEX.YELLOW
doc1.save( r'c:\temp\doc_output_file.docx'' )
Thank you in advance!