I have created the LO-Basic code below to insert a TextTable in a Writer document. I would remove spacing in every cell of the table (set automatically?) because i need more space for text in every cell: in LibreOffice Writer menus i do: Tables/Tables properties/Spacing to Contents.
How can I make this in LO-Basic?
Thank you for the reply
Sub CreaDocWriter
Dim sTipoDoc As String
Dim oMioDoc As Object
Dim oTesto As Object
Dim oCursore As Object
Dim tabellaA As Object
Dim aMediaDescriptor(0) as Object
Dim sStilePagina As String
Dim oStiliDiPagina as Object
Dim oStile As Object
Dim sUrl As String
Dim oLogo As Object
Set aMediaDescriptor(0) = New com.sun.star.beans.PropertyValue
'--------------------------------
'puntatori pagina/testo/cursore
'--------------------------------
sTipoDoc="private:factory/swriter"
oMioDoc = StarDesktop.loadComponentFromURL(sTipoDoc, "_default", 0, aMediaDescriptor)
oLogo = oMioDoc.createInstance("com.sun.star.text.GraphicObject")
oTesto = oMioDoc.Text
oCursore = oTesto.createTextCursor()
'--------------------------------
'dimensioni pagina
'--------------------------------
sStilePagina=oCursore.PageStyleName()
oStiliDiPagina = oMioDoc.StyleFamilies.getByName("PageStyles")
oStile = oStiliDiPagina.getByName(sStilePagina)
oStile.Width = 29700
oStile.Height = 21000
oStile.LeftMargin = 500
oStile.TopMargin = 500
oStile.RightMargin = 500
oStile.BottomMargin = 500
'--------------------------------
'creazione tabella-titolo
'--------------------------------
tabellaA = oMioDoc.createInstance("com.sun.star.text.TextTable")
tabellaA.initialize(4, 12) '4 righe 12 colonne
oTesto.insertTextContent(oCursore, tabellaA, False)
'--------------------------------
'imposta altre proprietà
'--------------------------------
SetProprietaTabellaA(tabellaA,oLogo,"aaaa","bbbb")
'--------------------------------
'salva documento
'--------------------------------
sUrl = GetPathDocAttuale+"test99.odt"
aMediaDescriptor(0).Name = "Overwrite"
aMediaDescriptor(0).Value = true
oMioDoc.storeAsURL(sUrl, aMediaDescriptor())
' '--------------------------------
' ' chiude il documento
' '--------------------------------
oMioDoc.close(True)
End Sub