Apache OpenOffice (AOO) Bugzilla – Issue 10239
It isn't possible to set print areas in a spreadsheet
Last modified: 2013-02-24 21:09:54 UTC
I'm trying to set print areas in a spreadshhet but setPrintAreas() method does not work correctly. Or am I doing something wrong? My code is : ------------------------------------------------------------------------------ oPrintArea = CreateUnoStruct("com.sun.star.table.CellRangeAddress") With oPrintArea .Sheet = 0 .StartColumn = 0 .StartRow = 0 .EndColumn = 7 .EndRow = 44 End With ThisComponent.Sheets.getByName("Sheet1").setPrintAreas(oPrintArea) ------------------------------------------------------------------------------ Although I want to set print areas, this script deletes all of them.
implementation issue
setPrintAreas needs a sequence of CellRangeAddress as argument. In Basic this is an array. Use something like the following: dim aAreas(0 to 0) as com.sun.star.table.CellRangeAddress aAreas(0) = oPrintArea ThisComponent.Sheets.getByName("Sheet1").setPrintAreas(aAreas())
closing the issue.