ParaLineSpacing is a structure, so it must be copied, modified and then replaced as a whole. The RGB() function returns a value which you assign to the ParaBackColor property.
Code: Select all
doc = thiscomponent
enum = doc.text.createenumeration
while enum.hasmoreelements
   elem = enum.nextelement
   if elem.supportsservice("com.sun.star.text.Paragraph") then
      elem.charfontname = "Arial"
      elem.charheight = 12
      LineSpace = elem.paralinespacing
      LineSpace.height = 150
      elem.paralinespacing = LineSpace
      elem.parabackcolor = rgb(200,200,0)
   end if
wend
Rather than create a macro, wouldn't it be easier just to modify the Paragraph styles of the document? Even in a macro it looks cleaner. The code below assumes you are using the Default paragraph style.
Code: Select all
Sub EditStyle
oStyleFamilies = ThisComponent.getStyleFamilies()
oPStyles = oStyleFamilies.getByName("ParagraphStyles")
DefaultStyle = oPStyles.getByName("Standard")
LineSpace = DefaultStyle.paralinespacing
LineSpace.height = 150
DefaultStyle.paralinespacing = LineSpace
DefaultStyle.parabackcolor = rgb(200,200,0)
End Sub
All of that can be done with a few clicks in the Styles and Formatting dialog ( menu Format -> Styles and Formatting)