int ColCount = xTextTable.getColumns().getCount();
XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, xTextTable);
XCellRange xLocCellRange = xCellRange.getCellRangeByPosition(0, 0, ColCount-1, 1);
short iHoriOrient = AnyConverter.toShort(Tools.getUNOPropertyValue(xTextTable, "HoriOrient"));
XSelectionSupplier xSelection = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class, xTextDocument.getCurrentController());
xSelection.select(xLocCellRange);
Tools.dispatchURL(xMSF, ".uno:DistributeColumns", xFrame);
Tools.dispatchURL(xMSF, ".uno:SetOptimalColumnWidth", xFrame);
Tools.setUNOPropertyValue(xTextTable, "HoriOrient", new Short(iHoriOrient));
XTextViewCursorSupplier xViewCursor = (XTextViewCursorSupplier) UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xTextDocument.getCurrentController());
XTextViewCursor xTextViewCursor = xViewCursor.getViewCursor();