settings
settings
¶
Settings object, providing access to document-level settings.
Settings
¶
Settings(
element: BaseOxmlElement,
parent: ProvidesXmlPart | None = None,
)
Bases: ElementProxy
Provides access to document-level settings for a document.
Accessed using the Document.settings property.
Source code in src/docx/settings.py
odd_and_even_pages_header_footer
property
writable
¶
True if this document has distinct odd and even page headers and footers.
Read/write.
track_revisions
property
writable
¶
True when Word records changes made to this document as tracked changes.
Read/write. This is the "Track Changes" toggle. Setting it does not mark anything already in the document as a revision; it asks Word to record what happens from now on.
update_fields_on_open
property
writable
¶
True when Word should recalculate every field when it opens this document.
Read/write. This library cannot compute a field result — a table of contents
added here is empty, and a PAGE field has no page number, because both depend
on how Word lays the document out. Setting this asks Word to fill them in as
soon as the document is opened, which is the only way to get a populated table
of contents out of a generated document.
Word prompts the reader before updating when the document has a table of contents, so a document saved with this set may show that prompt once.