[Solved] Macro to set cell borders and all inner lines
[Solved] Macro to set cell borders and all inner lines
from cells B50-R50 I would like to set all borders and all inner lines to black and 2.5 pt using a macro
Last edited by MATT.B on Wed Dec 18, 2019 9:19 pm, edited 1 time in total.
OpenOffice 4.1.1 ON WINDOWS 7 64
Re: macro to set cell borders and all inner lines
Search the forum with cell borders for many posts including my post with the bug and the workaround.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Re: macro to set cell borders and all inner lines
I have been searching for a while now and all i can find is code that uses con.star.beans or what ever it is and i dont understand that method. Is there a way of doing this a diferent way?
OpenOffice 4.1.1 ON WINDOWS 7 64
Re: macro to set cell borders and all inner lines
Im still learning i have gotten good figuring out stuff but when it comes to use that method im still very new.
OpenOffice 4.1.1 ON WINDOWS 7 64
Re: macro to set cell borders and all inner lines
Create a user defined Cell Style with double lined cell border (manually or programatically), and apply that Cell Style by your macro code to the desired cell/cell range.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: macro to set cell borders and all inner lines
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: macro to set cell borders and all inner lines
thank you this was helpfull. but quick question why does this work
Code: Select all
Cell = Sheet.getCellRangeByName("D1")
NewBorder = Cell.BottomBorder
NewBorder.OuterLineWidth = 88
Cell.BottomBorder = NewBorder
Edit: it does work i had a typo
Code: Select all
|
OpenOffice 4.1.1 ON WINDOWS 7 64
Re: [solved]Macro to set cell borders and all inner lines
code that worked for me
Code: Select all
oDoc = ThisComponent
osheets = odoc.getSheets()
osheet = osheets.getByIndex(0)
oCells = oSheet.getCellRangeByName("B50:R50")
NewBorder = oCells.BottomBorder
NewBorder.OuterLineWidth = 88
oCells.BottomBorder = NewBorder
NewBorder = oCells.TopBorder
NewBorder.OuterLineWidth = 88
oCells.sTopBorder = NewBorder
NewBorder = oCells.LeftBorder
NewBorder.OuterLineWidth = 88
oCells.LeftBorder = NewBorder
NewBorder = oCells.RightBorder
NewBorder.OuterLineWidth = 88
ocells.RightBorder = NewBorder
OpenOffice 4.1.1 ON WINDOWS 7 64
Re: [solved]Macro to set cell borders and all inner lines
Look at
http://www.openoffice.org/api/docs/comm ... rties.html
I think TableBorder might do the same as your four separate sides. - no, it will only border the entire range.
http://www.openoffice.org/api/docs/comm ... rties.html
I think TableBorder might do the same as your four separate sides. - no, it will only border the entire range.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS