Joel Cordeiro wrote:

in basic

   oDocument = ThisComponent

if oDocument.getCurrentSelection.SupportsService("com.sun.star.text.TextRanges") then
  oSelections = oDocument.getCurrentSelection
  sSelection = oSelections.getByIndex(0).getString()
elseif oDocument.getCurrentSelection.SupportsService("com.sun.star.text.TextFrame") then
       sSelection = oDocument.getCurrentSelection.GetText.GetString
endif

hope it helps

Fernand
Hi,

does anyone could help me about how to get the selected text in the actual
TextDocument (Writer)? How does we cast the returned object in the method
getCurrentSelection() ? Or there is another way?
If possible, a simple example would be really nice..

Regards,

Joel Filipe Antunes Cordeiro
[EMAIL PROTECTED]
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to