Michael Hinz
How can i set or change the header
/* get the desktop (an Xdesktop object) */
oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~{%see com.sun.star.frame.XDesktop%XDesktop}~{%see com.sun.star.frame.XComponentLoader%XComponentLoader} --get componentLoader interface
/* open a blank calc file */
url = "private:factory/scalc"
xCalcComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps)
/* get first sheet in spreadsheet */
xDocument = xCalcComponent~{%see com.sun.star.sheet.XSpreadsheetDocument%XSpreadSheetDocument}
xSheet = xDocument~getSheets~{%see com.sun.star.container.XIndexAccess%XIndexAccess}~getByIndex(0)~{%see com.sun.star.sheet.XSpreadsheet%XSpreadSheet}
/* insert value into cells */
CALL UNO.setCell xSheet, 0, 0, "The header is set!"
/*create an instance of page style*/
xServiceManager = xDocument~{%see com.sun.star.lang.XMultiServiceFactory%XMultiServiceFactory}
xPageStyle = xServiceManager~createInstance("{%see com.sun.star.style.PageStyle}")
xFamiliesSupplier = xDocument~{%see com.sun.star.style.XStyleFamiliesSupplier%XStyleFamiliesSupplier}
xStyle = xFamiliesSupplier~getStyleFamilies~getByName("PageStyles")~{%see com.sun.star.container.XNameContainer%XNameContainer}
/*get the header and turn it on*/
xHeader = xStyle~getByName( "Default" )
xHeader~{%see com.sun.star.beans.XPropertySet%XPropertySet}~setPropertyValue("HeaderIsOn", box("boolean", .true))
/*get the property value and set it*/
headerText = xHeader~{%see com.sun.star.beans.XPropertySet%XPropertySet}~getPropertyValue("RightPageHeaderContent")
xHeaderText = headerText~{%see com.sun.star.sheet.XHeaderFooterContent%XHeaderFooterContent}
xHeaderText~getLeftText()~setString("Rexx")
xHeaderText~getCenterText()~setString("was")
xHeaderText~getRightText()~setString("here")
XHeader~{%see com.sun.star.beans.XPropertySet%XPropertySet}~setPropertyValue("RightPageHeaderContent", xheaderText)
::requires UNO.cls -- get UNO support