Skip to content
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

Setting Custom properties on a Word doc in Linux not working #102

Open
johantre opened this issue Jan 5, 2024 · 1 comment
Open

Setting Custom properties on a Word doc in Linux not working #102

johantre opened this issue Jan 5, 2024 · 1 comment

Comments

@johantre
Copy link

johantre commented Jan 5, 2024

I've build a Word document generator that sets Custom properties in a Word document (serving as template) and saves the document afterwards. Like that each time a new document is generated, but with other Custom Properties set that can be sent together with an offer.

This all works like a charm on Windows.
However, running this on an Ubuntu Linux box, the properties aren't set and stay their default value: "****" :-(
My intention was to get this working in a Github pipeline, so preferably having this working under ubuntu-latest runner.
I've added basically the way I do this to illustrate below.

from docxcompose.properties import CustomProperties
from docx import Document

document = Document("WordTemplate.docx")
CustomProperties(document).update("my custom prop name", "my custom prop value")
document.save("new document name to save.docx")

My question: does docxcompose support Linux in setting Custom Properties?
I have a setup under ubuntu where I can debug etc. Any tips to investigate further would be very welcome.
Could this be a permission issue?
Is there a way I can check more deeply when a Custom Property is actually set or not?
Any pointers where/how to search would be very very welcome.
I do not encounter any exceptions along the way while debugging so I'm a little bit stuck in how to investigate further.
The original .py script I've added as a .txt file if it is of any help. That is somewhat more complex however.

Any pointers to help investigating any further would be very welcome. The most important answer would be the first question.
Is linux supported or not for doing this kind of things?

Thanks alot!

GenerateOfferDocuments.txt

@johantre
Copy link
Author

johantre commented Jan 7, 2024

In my search to get solutions I found the following in the log when starting up my script that caught my attention.
"MSOffice not found on this system: Trying abiword instead"

Am I looking at setting Custom properties as a feature that isn't supported by Abiword?
Shouldn't MSOffice not be mentioned as a requirement/dependency in the README.rst?

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

No branches or pull requests

1 participant