Skip to content

Add '.docm' compatibility#673

Open
1010G wants to merge 2 commits intopython-openxml:masterfrom
1010G:master
Open

Add '.docm' compatibility#673
1010G wants to merge 2 commits intopython-openxml:masterfrom
1010G:master

Conversation

@1010G
Copy link
Copy Markdown

@1010G 1010G commented May 13, 2019

Hello, I saw few topics about '.docm' (docx with maccro) compatibility files so I decided to create a pull request. I think that could help some peoples.

api.py: modify
if document_part.content_type not in [CT.WML_DOCUMENT_MAIN, CT.WML_DOCUMENT_MACRO_ENABLED_MAIN]:

constants.py: append
WML_DOCUMENT_MACRO_ENABLED_MAIN = ( 'application/vnd.ms-word.document.macroEnabled.main+xml' )

init.py: append
PartFactory.part_type_for[CT.WML_DOCUMENT_MACRO_ENABLED_MAIN] = DocumentPart

@jshlbrd
Copy link
Copy Markdown

jshlbrd commented Aug 5, 2019

@scanny any chance we can get a review on this? Related to this 3yo issue #284

Copy link
Copy Markdown

@lordofhyphens lordofhyphens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straightforward to me for minimal additional work.

@goncalor
Copy link
Copy Markdown

goncalor commented Aug 7, 2021

Hi. Will this PR not get merged? Thank you.

@scanny
Copy link
Copy Markdown
Contributor

scanny commented Aug 7, 2021

Not in its present state. There is no analysis documentation and no tests. The analysis document would need to account for how macros are stored in the .pptx package and document experiments that showed the macros were preserved on save and otherwise support reasoning about the mechanism used to establish support for .docm files and where it may be insufficient or have unintended consequences.

If this solution is good enough for your purposes you can just merge it into a private fork of the latest release and use that private fork.

goncalor added a commit to goncalor/python-docx that referenced this pull request Aug 9, 2021
@cobnett3
Copy link
Copy Markdown

FYI, #716

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants