[Solved] Print range in Calc

Creating a macro - Writing a Script - Using the API

[Solved] Print range in Calc

Postby ANteC » Tue Apr 15, 2008 11:17 am

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.
ANteC
 
Posts: 10
Joined: Tue Apr 15, 2008 11:07 am

Re: Print range in Calc

Postby Tribio » Tue Apr 15, 2008 2:10 pm

Code: Select all   Expand viewCollapse view
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
User avatar
Tribio
 
Posts: 5
Joined: Thu Mar 27, 2008 5:40 pm

Re: Print range in Calc

Postby ANteC » Wed Apr 16, 2008 10:52 am

Thank you. There is what i need.
ANteC
 
Posts: 10
Joined: Tue Apr 15, 2008 11:07 am


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 9 guests