Here is as far as I could get:
sub Testing
dim tables as object
dim table as object
dim columns as object
dim column as object
dim index as integer
tables = ThisComponent.TextTables
if tables.Count > 0 then
table = tables.getByIndex(0)
columns = table.columns
table.Width = 850 * columns.Count '850 == 0.85 cm
for index = 0 to columns.Count - 1
column = columns.getByIndex(index)
'column is always NULL
'column.Width = 850
next
end if
end sub
Major problems noted:
No way to retrieve the actual table you want to modify via
ThisComponent.CurrentSelection
, so instead hardcoded to the table at index 0Any changes to the table don't seem to be reflected in the document, and no obvious way to re-render or refreshSeems to be working now! But still looking for a way to call the function to distribute columns evenlycolumns.getByIndex
always returnsNULL
!, and there's no documentation on how to use the column enumeration class within Basic
Based on this investigation, would advise against trying to do anything productive with LibreOffice 4.1 Writer Basic macros.