Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class UnoClient {
- public static void main(String[] args) {
- AbstractOpenOfficeConnection cnx = null;
- try {
- cnx = new PipeOpenOfficeConnection( "somename" );
- System.out.println("Connecting to OOo...");
- cnx.connect();
- System.out.println( "Trying to get the component context" );
- if ( cnx.getComponentContext() != null ) {
- XComponentContext xCtx = cnx.getComponentContext();
- // TODO Use the UNO connection here
- }
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if ( cnx != null ) {
- System.out.println( "Disconnecting from OOo..." );
- cnx.disconnect();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement