Java UNO window listener how to get current writer doc text

Hi, I’ve been trying to come to grips with UNO API in Java. The application I’ve inherited launches the swriter app and uses the event handler facility to capture the actions of the user (record). In my top window event listener I’d like to examine/capture the text that is present in the XText/XTextDocument/??? object that the event has notified me of changes (the event ID is STATE_CHANGE, the accessible name is Align Right, and the role is Toggle_button.) My problem is that I can’t seem to find the right combination of UnoRuntime.queryInterface() operations to expose the “XText” component or XSelectedText component using the available event information passed.

So, is there a way to expose this XAccessible XText object from a window event handler/listener? If so, what’s the trick (in Java of course)?

Hi @waynemot,

Have you found an Answer to your Question yet?

If not, I can try to track down someone more familiar with the Java API…