Hi Daniel
The problem is that I want to insert text in the document the user is
actually editing, and not in the Frame the programm opened.
Imagine the user opens an already existent file. This would open a new
frame. Then inserting text from my java application, the text will
appear in the Frame he opened first, and not in the frame he is
actually editing - which is not the expected behaviour.
So, I wanted to now how to get the current frame ...
aaaah, now the shades of confusion lift :-)
You can query the XDesktop interface from an instance of the service
"com.sun.star.frame.Desktop", which you can create at the
MultiServiceFactory of the office.
The interface XDesktop has a method "getCurrentComponent()" which should
return the currently active StarOffice component.
To ensure that the component you get is a TextDocument you can check if
it supports the service "com.sun.star.text.TextDocument" by querying the
XServiceInfo interface and use the method "supportsService" from it.
Hope that helps
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]