// Set the name of our new section (appropiately) to 'Fish'
xSectionNamed.setName ( "Fish" );
// Create the TextColumns service and get it's XTextColumns interface
XTextColumns xColumns = (XTextColumns) UnoRuntime.queryInterface( XTextColumns.class,
mxDocFactory.createInstance ( "com.sun.star.text.TextColumns" ) );
// We want three columns
xColumns.setColumnCount ( (short) 3 );
// Get the TextColumns, and make the middle one narrow with a larger margin
// on the left than the right
TextColumn[] aSequence = xColumns.getColumns ();
aSequence[1].Width /= 2;
aSequence[1].LeftMargin = 350;
aSequence[1].RightMargin = 200;
// Set the updated TextColumns back to the XTextColumns
xColumns.setColumns ( aSequence );
// Get the property set interface of our 'Fish' section
XPropertySet xSectionProps = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xSectionNamed );