-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add custom properties support + unit-tests, feature-tests #1273
base: master
Are you sure you want to change the base?
Add custom properties support + unit-tests, feature-tests #1273
Conversation
Hi @scanny, I did the rebase, as you suggested. Is there anything more you need to be done, to have this long-running MR merged? Best regards, |
Still looking forward to this since 2018! ;) Thanks for all the hard work!!!! |
Hi, first of all thanks for your work. There is only one issue for me: |
@ssmoliarchuk: Yes I know about this issue. My workaround is to select the area in the document and have Word refresh all dynmic fields. Interestingly, the issue does not occur in LibreOffice. |
Hi, thanks for your work! Sad that this feature is still not merged :-( |
Hi all, I have been using this change for a few months now and have enjoyed it, thank you for your work on this @michael-koeller. My team and I have noticed, however, that when opening documents created with We have been able to trace this back to the namespace prefix used in this PR for custom-properties, namely To recreate the above from docx import Document
d = Document()
d.add_paragraph("Test text.)
d.custom_properties["test_prop"] = "foo"
d.save("/path/to/document.docx") Microsoft's DocumentFormat.OpenXml documentation says the prefix is It looks like creating a new To recreate the above document in MS Word:
To test a crude potential fix, I changed the definition of the xmlns = 'xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"'
_customProperties_tmpl = "<Properties %s/>\n" % (xmlns + " " + nsdecls("vt")) and changed definitions of Any thoughts? I'd love to contribute by cleaning up my changes and opening a PR into your branch @michael-koeller |
@ryanamannion: Thanks for the detailed input. I'll soon have a look into it. |
I have been looking into this more to make a proper fix for BlackBoiler's fork of python-docx. Using dotnet's Open XML Productivity Tool, validation revealed that the actual issue was the missing namespace tag on python-docx now generates a The resulting document does not raise "Unreadable Content" warnings when opening with MS Word, and is validated successfully with the Open XML Productivity Tool Code changes to achieve this can be viewed at a glace here: BlackBoiler#25 |
Follow-up to MR #580, which I closed unintendedly.
Sorry for any inconveniences.