On Thu, Feb 28, 2008 at 6:35 AM, Dinesh Chothe <[EMAIL PROTECTED]> wrote:
> 1. How do I get access selected text? From where I would get
> similar kind of sample programs ?
I assume that xDoc variable contains XTextDocument. Following piece of
code should help ...
XModel xModel = ( XModel ) UnoRuntime.queryInterface( XModel.class, xDoc );
XController xController = xModel.getCurrentController();
XTextViewCursorSupplier xTVCSupplier = ( XTextViewCursorSupplier )
UnoRuntime.queryInterface(
XTextViewCursorSupplier.class, xController );
XTextViewCursor xTVC = xTVCSupplier.getViewCursor();
xTVC.getString() & xTVC.setString() are your friends.
... if you're looking for more complicated selections, you should
search for XSelectionSupplier, TextView, etc. This topic is covered in
Developer's Guide.
--
Robert Vojta
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]