The following code pertains to one button and its action
Code: Select all
sub Product_Info
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 = "ToPoint"
args1(0).Value = "1Information.D6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "StringName"
args2(0).Value = "=2Data.C1"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())
rem ----------------------------------------------------------------------
Dim oDoc As Object
Dim Page As Object
Dim RectangleShape As Object
oDoc = thisComponent
page = oDoc.drawPages(0)
RectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape")
nNumShapes = Page.getCount()
For i = 1 To nNumShapes - 10
RectangleShape = Page.getByIndex(i)
if RectangleShape.LayerName <ProductInfo> "i" then
goto nextShape
end if
if RectangleShape.FillColor = RGB (114, 159, 207) then
RectangleShape.FillColor = RGB (61, 174, 233)
else
RectangleShape.FillColor = RGB (114, 159, 207)
end if
nextShape:
next i
end sub