Skip to content

extendedprops

extendedprops

Provides ExtendedProperties, the application-specific document properties.

These are the properties stored in /docProps/app.xml, such as the word count, the editing time and the application that produced the document. They complement the Dublin-Core properties in /docProps/core.xml exposed by CoreProperties.

ExtendedProperties

ExtendedProperties(element: CT_ExtendedProperties)

Corresponds to part named /docProps/app.xml.

Every property reads None when the corresponding element is absent from the XML, which is the normal state for most of them. Assigning None removes the element.

Word maintains the statistics properties (pages, words, characters, characters_with_spaces, lines, paragraphs) itself and recalculates them when the document is next opened and repaginated. Values written here are what a reader sees before that happens; this library does not compute them.

Source code in src/docx/opc/extendedprops.py
def __init__(self, element: CT_ExtendedProperties):
    self._element = element

template property writable

template: str | None

Name of the template attached to the document, e.g. "Normal.dotm".

manager property writable

manager: str | None

Name of the manager recorded for the document.

company property writable

company: str | None

Name of the company recorded for the document.

application property writable

application: str | None

Name of the application that produced the document.

app_version property writable

app_version: str | None

Version of the producing application, formatted "MM.mmmm".

presentation_format property writable

presentation_format: str | None

Intended presentation format. Rarely set by Word.

hyperlink_base: str | None

Base path that relative hyperlinks in the document resolve against.

pages property writable

pages: int | None

Page count last recorded by the producing application.

words property writable

words: int | None

Word count last recorded by the producing application.

characters property writable

characters: int | None

Character count excluding spaces.

characters_with_spaces property writable

characters_with_spaces: int | None

Character count including spaces.

lines property writable

lines: int | None

Line count last recorded by the producing application.

paragraphs property writable

paragraphs: int | None

Paragraph count last recorded by the producing application.

total_time property writable

total_time: int | None

Cumulative editing time in minutes.

doc_security property writable

doc_security: int | None

Document security flags, e.g. 1 for password-protected, 2 for read-only.

This records the intent of the producing application. It is not enforced by this library and provides no security guarantee.

scale_crop property writable

scale_crop: bool | None

True when the document thumbnail is scaled, False when cropped.

links_up_to_date: bool | None

True when hyperlinks in the document are known to be current.

shared_doc property writable

shared_doc: bool | None

True when the document is flagged as shared between multiple authors.

hyperlinks_changed: bool | None

True when hyperlinks changed and the producing application should update.