- Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
the simple code
fromdocximportDocumentdoc=Document(r"xxxx.docx") print(doc.part.numbering_part)The following issues have occurred
Traceback (most recent call last): File "x.py", line 4, in <module> print(doc.part.numbering_part) File "\mars-win-amd64-python3.9\lib\site-packages\docx\shared.py", line 242, in __get__ value = self._fget(obj) File "\mars-win-amd64-python3.9\lib\site-packages\docx\parts\document.py", line 99, in numbering_part numbering_part = NumberingPart.new() File "\mars-win-amd64-python3.9\lib\site-packages\docx\parts\numbering.py", line 15, in new raise NotImplementedError NotImplementedError After investigation, it was found that the 'NumberingPart. new()' used in the 'numbing_part' did not implement the function.
The following is the code used by 'NumberingPart.new()'
classNumberingPart(XmlPart): """Proxy for the numbering.xml part containing numbering definitions for a document or glossary."""@classmethoddefnew(cls): """Return newly created empty numbering part, containing only the root ``<w:numbering>`` element."""raiseNotImplementedErrorMetadata
Metadata
Assignees
Labels
No labels