[Calc, Python] Apply Outer Borders

Shared Libraries
Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This section is not for asking questions about writing your own macros.
Post Reply
User avatar
Villeroy
Volunteer
Posts: 31282
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

[Calc, Python] Apply Outer Borders

Post 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.
Attachments
OuterBorders2.py.odt
Writer doc with install macro
(32.51 KiB) Downloaded 291 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply