[Solved] Print range in Calc

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
ANteC
Posts: 10
Joined: Tue Apr 15, 2008 11:07 am

[Solved] Print range in Calc

Post by ANteC »

Hello. Please help me with OO Basic.

How i can set pring range (i have cellrange and need set it as one page for division into pages) ?

Sorry my English.
Last edited by Hagar Delest on Tue Jun 10, 2008 2:00 pm, edited 2 times in total.
Reason: tagged the thread as Solved.
User avatar
Tribio
Posts: 5
Joined: Thu Mar 27, 2008 5:40 pm

Re: Print range in Calc

Post by Tribio »

Code: Select all

Dim oDoc as Object
Dim oPrintArea (0) as New com.sun.star.table.CellRangeAddress

...

oPrintArea (0).Sheet = 1
oPrintArea (0).StartColumn = 0
oPrintArea (0).StartRow = 0
oPrintArea (0).EndColumn = 5
oPrintArea (0).EndRow = 10

oDoc.Sheets.getByName ("Sheet 1").setPrintAreas (oPrintArea ())
This code will create a print range on the sheet named "Sheet 1". The range consists of the area A1:F11.

Hope this suits your needs.
Image
ANteC
Posts: 10
Joined: Tue Apr 15, 2008 11:07 am

Re: Print range in Calc

Post by ANteC »

Thank you. There is what i need.
Post Reply