Skip to content

Add '.docm' compatibility #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

1010G
Copy link

@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

jshlbrd commented Aug 5, 2019

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

Copy link

@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

goncalor commented Aug 7, 2021

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

@scanny
Copy link
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
@tsuga
Copy link

tsuga commented Sep 12, 2021

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