Change FillColor TableShape
Posted: Wed Mar 29, 2017 9:15 pm
Hi!
I need help.
I use macro from book Andrew Pitonyak.
How i can change color this table in macro? In document i can change color table manually.example table after use this macro in attachment.
I tried code,
but not work.
in the same time code
working
Thanks!
P.S. Sorry for my English.
I need help.
I use macro from book Andrew Pitonyak.
Code: Select all
Sub DrawTableShape
Dim oSize as New com.sun.star.awt.Size
Dim oPos as New com.sun.star.awt.Point
Dim oPage
Dim oTable
Dim oCell
Dim oDrawDoc ' Temporary draw document.
oDrawDoc = ThisComponent
' Set a size and table position.
oSize.Width = 6000 : oSize.Height = 6100
oPos.X = 6000 : oPos.Y = 5000
' Get the first draw page
oPage = oDrawDoc.DrawPages.getByIndex(0)
oTable = oDrawDoc.createInstance("com.sun.star.drawing.TableShape")
oPage.add(oTable)
oTable.Name="TEST3"
oTable.Model.Rows.InsertByIndex(1,4)
oTable.Model.Columns.InsertByIndex(1,4)
oTable.setSize(oSize)
oTable.setPosition(oPos)
oCell = oTable.Model.getCellByPosition(0,1)
oCell.getText().setString("X")
End Sub
I tried code,
Code: Select all
oStyle=oTable.Style
oStyle.FillColor=RGB(255,0,0)
in the same time code
Code: Select all
oStyle.ShadowColor=RGB(255,0,0)
Thanks!
P.S. Sorry for my English.