 | OO-Snippets: pageSizeCommons| Keywords | |
|---|
| Language | ooRexx |
|---|
| Application | Calc |
|---|
| Authors | Michael Hinz (initial)
|
|---|
| Supported Versions | 2.0.x |
|---|
| Supported OS | Win32 |
|---|
| Question | How can i change the page size
|
|---|
| Answer | |
|---|
oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~XDesktop~XComponentLoader
url = "private:factory/scalc"
xCalcComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps)
xDocument = xCalcComponent~XSpreadSheetDocument
xSheet = xDocument~getSheets~XIndexAccess~getByIndex(0)~XSpreadSheet
CALL UNO.setCell xSheet, 0, 0, "Please change the view"
xServiceManager = xDocument~XMultiServiceFactory
xPageStyle = xServiceManager~createInstance("com.sun.star.style.PageStyle")
xFamiliesSupplier = xDocument~XStyleFamiliesSupplier
xStyle = xFamiliesSupplier~getStyleFamilies~getByName("PageStyles")~XNameContainer
xPage = xStyle~getByName( "Default" )
xPageSize = xPage~XPropertySet~getPropertyValue("Size")
CALL syssleep 5
height = xPageSize~Height
xPageSize~Height = xPageSize~Width
xPageSize~Width = height
xPage~xPropertySet~setPropertyValue("Size",xPageSize)
xPage~xPropertySet~setPropertyValue("IsLandscape", box("new Boolean", (true)))
CALL syssleep 5
width = 5000
height = 10000
xPageSize~Height = height
xPageSize~Width=height = width
xPage~xPropertySet~setPropertyValue("Size",xPageSize)
xPage~xPropertySet~setPropertyValue("IsLandscape", box("new Boolean", (true)))
::requires UNO.cls
|
|