I have been using this line to get a specific sheet to work with it
oSheet = oDoc.getSheets().getByIndex(0)
With the above line it draws border only to specified index sheet
But I want to use multiple sheets to draw border at the same time
How to do that ?
[Solved] Draw Border To Multiple Sheets at the same time
[Solved] Draw Border To Multiple Sheets at the same time
Last edited by Hagar Delest on Tue Nov 19, 2019 9:00 am, edited 2 times in total.
Reason: tagged solved
Reason: tagged solved
Open Office 4.1.7
Re: To Draw Border To Multiple Sheets at the same time
Hi,
either you specify which sheets you want by changing the last number:
Or you can change all one by one:
either you specify which sheets you want by changing the last number:
Code: Select all
oDoc=ThisComponent
oSheet = oDoc.getSheets().getByIndex(0)
rem do something
oSheet = oDoc.getSheets().getByIndex(1)
rem do something
Code: Select all
oDoc=ThisComponent
for i=0 to oDoc.getsheets().count-1
oSheet = oDoc.getsheets().getbyindex(i)
rem do something
next i
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/li ... itect.html
Re: To Draw Border To Multiple Sheets at the same time
This is what templates are about. All office suites are mainly about templates. Generating new documents by means of program code is stupid even if you were able to program.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: To Draw Border To Multiple Sheets at the same time
Hey
Thanks the For Loop worked .
But its applying border to all sheets now
I want to apply border from 2nd sheet till so on
i dont want border on the first sheet.
Can u please suggest code to apply border for all sheets except the first sheet?
Thanks the For Loop worked .
But its applying border to all sheets now
I want to apply border from 2nd sheet till so on
i dont want border on the first sheet.
Can u please suggest code to apply border for all sheets except the first sheet?
Open Office 4.1.7
Re: To Draw Border To Multiple Sheets at the same time
If you are a programmer, you must know the solution method.
Just start the Loop from 1 instead of the 0
Or you can apply a different Style to the first Sheet. Always work with styles instead of the direct formatting properties!
The Styles is the most valable property of the AOO/LO.
Or simple open a preformatted Template by your program code, - as Villeroy suggested. Use the Styles for the formating the Template.
Just start the Loop from 1 instead of the 0
Or you can apply a different Style to the first Sheet. Always work with styles instead of the direct formatting properties!
The Styles is the most valable property of the AOO/LO.
Or simple open a preformatted Template by your program code, - as Villeroy suggested. Use the Styles for the formating the Template.
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: To Draw Border To Multiple Sheets at the same time
Thanks ZiZi
Thanks for the help means a lot
We all are learners here
Thanks for the help means a lot
We all are learners here
Open Office 4.1.7