I have inserted a table in swriter from Delphi, I can then insert text into it, no problem for that.
The problem is for adjusting the columns automatically or not, nothing works.
I create the table like that :
Code: Select all
oTable := DocumentOpenOffice.createInstance('com.sun.star.text.TextTable');
oTable.initialize( NbRows + 1 , NbCols );
Goto_BookMark(AnBkmName,ADocName);
oCurseur := DocumentOpenOffice.getCurrentController.getViewCursor;
oText := DocumentOpenOffice.getText;
oText.insertTextContent( oCurseur, oTable, true );
// first try to change the columns width : NO EFFECT
tabSeparateur := oTable.TableColumnSeparators;
tabSeparateur[0].Position := 3000;
tabSeparateur[1].Position := tabSeparateur[1].Position + 5000;
tabSeparateur[2].Position := tabSeparateur[2].Position + 2000;
tabSeparateur[3].Position := tabSeparateur[3].Position + 2000;
oTable.TableColumnSeparators := tabSeparateur;
// then several tries to access columns optimalWidth property...
// but always exception raised +/- like "no such property...
// hours spent on the web with no solution...
Thanks.