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.

Editing Text Documents 100<br />

jumps to the end of the current paragraph.<br />

gotoNextParagraph (Expand)<br />

jumps to the start of the next paragraph.<br />

gotoPreviousParagraph (Expand)<br />

jumps to the start of the previous paragraph.<br />

isStartOfParagraph ()<br />

returns True if the TextCursor is at the start of a paragraph.<br />

isEndOfParagraph ()<br />

returns True if the TextCursor is at the end of a paragraph.<br />

The text is divided into sentences on the basis of sentence symbols. Periods are, for<br />

example, interpreted as symbols indicating the end of sentences.<br />

The Expand parameter is a Boolean value which specifies whether the area passed over<br />

during navigation is to be highlighted. All navigation methods furthermore return a<br />

parameter which specifies whether the navigation was successful or whether the action was<br />

terminated for lack of text.<br />

The following is a list of several methods for editing highlighted areas using a TextCursor<br />

and which also support the<br />

service:<br />

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

collapseToStart ()<br />

resets the highlighting and positions the TextCursor at the start of the previously<br />

highlighted area.<br />

collapseToEnd ()<br />

resets the highlighting and positions the TextCursor at the end of the previously<br />

highlighted area.<br />

isCollapsed ()<br />

returns True if the TextCursor does not cover any highlighting at present.<br />

Formatting Text with TextCursor<br />

The<br />

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

service supports all the character and paragraph properties that were presented at the<br />

start of this chapter.<br />

The following example shows how these can be used in conjunction with a TextCursor. It<br />

passes through a complete document and formats the first word of every sentence in bold<br />

type.<br />

Dim Doc As Object<br />

Dim Cursor As Object<br />

Dim Proceed As Boolean

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

Saved successfully!

Ooh no, something went wrong!