OO-Snippets: Document Background

Commons

Keywordsdocument background, background, background color
LanguageooRexx
ApplicationWriter
AuthorsMatthias Prem (initial)
Supported Versions2.0.x  
Supported OSAll  
QuestionHow can I change the document's background color?
Answer

Code-Snippet-Listing (snippet-source)

/* DocumentBackground.rex */
/* Macro */

/* get the script context and the Document */
xScriptContext=uno.getScriptContext()
oDoc=xScriptContext~getDocument

/* The xFamiliesSupplier includes the PageStyles */
xFamiliesSupplier=oDoc~XStyleFamiliesSupplier
xStyle=xFamiliesSupplier~getStyleFamilies~getByName("PageStyles")~XNameContainer

/* the background is part of the PageStyle */
xBackground = xStyle~getByName("Standard")~xPropertySet
/* set the background color */
xBackground~setPropertyValue("BackColor", box("int", "123456"x ~c2d))

::requires UNO.CLS

Changelog

DateUserModification
2006-07-10matthiaspremInitial version

and