I am copying and pasting a range with data from Calc into a table in Writer, using the get/insertTransferable methods. Once there, I’d like to be able to access the newly created table’s particular column’s property to change its width, but for some reason I’m only able to get the the group of columns. Not sure what am I doing wrong here.
sub test_copyToWriter
dim oDoc as object: oDoc = ThisComponent
dim oCtrl as object: oCtrl = ThisComponent.currentController
dim writerDoc as object: writerDoc = openWriterDoc
dim rData as Object
dim idx as integer
dim tData as object
dim wTables as object
dim wTable as object
dim wColumns as object
dim wColumn as objectrData = oDoc.Sheets(0).getCellRangeByName(“D1:f2”)
oCtrl.Select(rData)
tData = ThisComponent.CurrentController.getTransferable(tData)
writerDoc.CurrentController.insertTransferable(tData)wTables = writerDoc.getTextTables()
wTable = wTables(0)
wColumns = wTable.getColumns()
wColumn = wColumns.getByIndex(0) ← this here does not throw an error, but does not assign an object to the variable either.
end sub