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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Templates 86<br />

Doc = StarDesktop.CurrentComponent<br />

StyleFamilies = Doc.StyleFamilies<br />

CellStyles = StyleFamilies.getByName("CellStyles")<br />

The example uses the StyleFamilies property of a spreadsheet document to establish a list<br />

containing all available cell templates.<br />

The individual templates can be accessed directly by means of an index:<br />

Dim Doc As Object<br />

Dim Sheet As Object<br />

Dim StyleFamilies As Object<br />

Dim CellStyles As Object<br />

Dim CellStyle As Object<br />

Dim I As Integer<br />

Doc = StarDesktop.CurrentComponent<br />

StyleFamilies = Doc.StyleFamilies<br />

CellStyles = StyleFamilies.getByName("CellStyles")<br />

For I = 0 To CellStyles.Count - 1<br />

CellStyle = CellStyles(I)<br />

MsgBox CellStyle.Name<br />

Next I<br />

The loop added since the previous example displays the names of all cell templates one<br />

after another in a message box.<br />

Details about various formatting options<br />

Each type of template provides a whole range of individual formatting properties. Here is<br />

an overview of the most important formatting properties and the points at which they are<br />

explained:<br />

• Character properties,<br />

com.sun.star.style.CharacterProperties<br />

service<br />

• Paragraph properties,<br />

com.sun.star.text.Paragraph<br />

service<br />

• Cell properties,<br />

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

service

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

Saved successfully!

Ooh no, something went wrong!