OOo Basic で OOo Calc のセルの背景色を設定する
REM ***** BASIC ***** sub Main rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(4) as new com.sun.star.beans.PropertyValue args1(0).Name = "BackgroundPattern.Transparent" args1(0).Value = false args1(1).Name = "BackgroundPattern.BackColor" args1(1).Value = 32768 args1(2).Name = "BackgroundPattern.URL" args1(2).Value = "" args1(3).Name = "BackgroundPattern.Filtername" args1(3).Value = "" args1(4).Name = "BackgroundPattern.Position" args1(4).Value = com.sun.star.style.GraphicLocation.NONE dispatcher.executeDispatch(document, ".uno:BackgroundPattern", "", 0, args1()) end sub
ただ,次の様に減量できた.
REM ***** BASIC ***** sub Main rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "BackgroundPattern.BackColor" args1(0).Value = 32768 dispatcher.executeDispatch(document, ".uno:BackgroundPattern", "", 0, args1()) end sub