Hi stephan
I suppose you have an XTextRange as base for your calculation.
Yes i do :)
The following macro should count the lines of a selected text, but by replacing the first line with your text range it should work for you too :-)
Yes it should that's almost ok :)
while thiscomponent.getText.compareRegionEnds(textCursor,viewCursor)<0 viewCursor.goDown(1,false) counter = counter +1 wend msgbox "lines in selected paragraph "+counter
The trick with a view cursor will work I didn't try this as i was searching for Non-view methods
Nevertheless, i'll save the current selection before and restore it at the end. But his will flicker for the user ...
Thanks anyway
Laurent
-- Laurent Godard <[EMAIL PROTECTED]> - Ing�nierie OpenOffice.org Indesko >> http://www.indesko.com Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org Livre "Programmation OpenOffice.org", Eyrolles 2004
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
