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.

Editing Spreadsheet Documents 151<br />

STRING<br />

numerical values that are formatted as date or time<br />

strings<br />

ANNOTATION<br />

comments that are linked to cells<br />

FORMULA<br />

formulas<br />

HARDATTR<br />

STYLES<br />

direct formatting of cells<br />

indirect formatting<br />

OBJECTS<br />

drawing objects that are connected to cells<br />

EDITATTR<br />

character formatting that only applies to parts of the cells<br />

You can also add the constants together to delete different information using a call from<br />

clearContents.<br />

Searching and Replacing Cell Contents<br />

Spreadsheet documents, like text documents, provide a function for searching and<br />

replacing.<br />

The descriptor objects for searching and replacing in spreadsheet documents are not<br />

created directly through the document object, but rather through the Sheets list. The<br />

following is an example of a search and replace process:<br />

Dim Doc As Object<br />

Dim Sheet As Object<br />

Dim ReplaceDescriptor As Object<br />

Dim I As Integer<br />

Doc = StarDesktop.CurrentComponent<br />

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

ReplaceDescriptor = Sheet.createReplaceDescriptor()<br />

ReplaceDescriptor.SearchString = "is"<br />

ReplaceDescriptor.ReplaceString = "was"<br />

For I = 0 to Doc.Sheets.Count - 1<br />

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

Sheet.ReplaceAll(ReplaceDescriptor)<br />

Next I

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

Saved successfully!

Ooh no, something went wrong!