Hi there.
Is there any way to interact with Table AutoFormat using UNO?
Or is there any way of saving a TableStyle to a document?
Thanks
Hi there.
Is there any way to interact with Table AutoFormat using UNO?
Or is there any way of saving a TableStyle to a document?
Thanks
Always mention OS and LibreOffice Version.
(Table Styles were implemented with V 5.3.)
.uno:
command supporting the needed arguments.API
name of the relevant property of a TextTable
having assigned a style is TableTemplateName
. (“Don’t miss an opportunity to mess up terms!”)Thank you for your reply, that’s interesting. I was confused because in python, if I do:
families = document.getStyleFamilies().getElementNames()
for family in families:
styles = document.getStyleFamilies().getByName(family).getElementNames()
for style in styles:
print(family + ": " + style)
I can see that there is the table styles listed there - but if I open the document on a new system, the table styles are gone.
I have since seen here that the table styles are stored in the LibreOffice user profile!
So, for my use case, I will have my users retrieve the autotbl.fmt
file from their config folder, if they want to customise the look of the tables.
Thanks again for the help.
I didn’t research into the user profile insofar, but the reported observation can’t be correct and complete enough. My example loaded with an older PortableApps version of LibO where the used custom Table style surely isn’t “profiled” shows it correctly, and the given code does as expected.
Well, Python users may dislike Basic, but my code isn’t poisonous, and the bridge from onboard Basic to the API is short, wide, and simple to use… Simply run it in the Basic IDE step by step to learn what I wanted to show.