Page 1 of 1

[Calc, Python] Apply Outer Borders

Posted: Fri Mar 31, 2023 12:21 pm
by Villeroy
It is difficult to apply outer borders to sheet cells. Cell styles don't help, since an outer border may include a wide range of differently formatted cells.
The attached Writer document installs a Python macro which applies up to 4 outer borders to an arbitrary selection of cell ranges. The borders need to be defined in a user defined cell style named "Outer Borders".

Recommended user interface: add a button to Calc's "Formatting" toolbar.

3 hours after publishing, karolus pointed out a much simpler variant on https://ask.libreoffice.org/t/have-a-ma ... s/89912/12 The installer in attachment OuterBorders2.py.odt overwrites the previous version with a much shorter one doing the same.