TableShape in Draw .... TextHorizontalAdjust ....appears to not work

It would appear that I am missing something fundamental, as I cannot get TextHorizontalAdjust to work in a cell in TableShape, used in Libre Office Draw.

The presented macro is from Andrew Pitonyak pg 586, Macros explained, with minor changes.

Thanks

Sub DrawTableShape

Dim oSize as New com.sun.star.awt.Size
Dim oPos as New com.sun.star.awt.Point
Dim oPage
’ Draw page to contain the shape.
Dim oTable
’ Table to insert.
Dim oCell
’ A cell that will contain a value.
Dim oDrawDoc ’ Temporary draw document.
oDrawDoc = ThisComponent ’ LoadEmptyDocument(“sdraw”)
’ 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)
’ Set the number of rows and columns to 5
oTable.Model.Rows.InsertByIndex(1,4)
oTable.Model.Columns.InsertByIndex(1,2) 'oTable.Model.Columns.InsertByIndex(1,4)
oTable.setSize(oSize)
oTable.setPosition(oPos)
’ Get the cell in the first column and second row and set to contain the text X.
oCell = oTable.Model.getCellByPosition(0,1)
oCell.getText().setString(“X”)

'////////////////////////////
’ ******** DOES NOT WORK: Nothing happens… .********************
’ TableShape Text Alignment
’ **************************
Align = com.sun.star.drawing.TextHorizontalAdjust.RIGHT

oCell.getText().TextHorizontalAdjust = Align

'////////////////////////////////////////

’ Get the cell in the third row and column.
oCell = oTable.Model.getCellByPosition(2,2)
’ Fill the cell with a bitmap of an image.
oCell.FillStyle = com.sun.star.drawing.FillStyle.BITMAP
oCell.FillBitmapURL = _
http://www.openoffice.org/images/AOO_logos/OOo_Website_v2_copy.png
End Sub

This appears to work… .

oCell.setPropertyValue("ParaAdjust", com.sun.star.style.ParagraphAdjust.CENTER)