21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Formatting Spreadsheet Documents 136<br />

VertJustify (enum)<br />

vertical justification of the text (value from<br />

com.sun.star.table.CellVertJustify<br />

)<br />

Orientation (enum)<br />

orientation of text (value in accordance with<br />

com.sun.star.table.CellOrientation<br />

)<br />

IsTextWrapped (Boolean)<br />

permits automatic line breaks within the cell<br />

RotateAngle (Long)<br />

angle of rotation of text in hundredths of a degree<br />

The following example shows how you can "stack" the contents of a cell so that the<br />

individual characters are printed one under another in the top left corner of the cell. The<br />

characters are not rotated.<br />

Dim Doc As Object<br />

Dim Sheet As Object<br />

Dim Cell As Object<br />

Doc = StarDesktop.CurrentComponent<br />

Sheet = Doc.Sheets(0)<br />

Cell = Sheet.getCellByPosition(1,1)<br />

Cell.Value = 1000<br />

Cell.HoriJustify = com.sun.star.table.CellHoriJustify.LEFT<br />

Cell.VertJustify = com.sun.star.table.CellVertJustify.TOP<br />

Cell.Orientation = com.sun.star.table.CellOrientation.STACKED<br />

Number, Date and Text Format<br />

<strong>OpenOffice</strong>.<strong>org</strong> provides a whole range of predefined date and time formats. Each of these<br />

formats has an internal number that is used to assign the format to cells using the<br />

NumberFormat property. <strong>OpenOffice</strong>.<strong>org</strong> provides the queryKey and addNew methods so<br />

that you can access existing number formats as well as create your own number formats.<br />

The methods are accessed through the following object call:<br />

NumberFormats = Doc.NumberFormats

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!