Page 1 of 1

Control the display of a presentation from C#

Posted: Sat Nov 22, 2008 12:24 am
by tbberg
Hi!

Does anyone have any examples of how to control a presentation from .NET(especially C#). I want to be able to control the slide advancement from my program.
As far as I understand you should start OO with these arguments (or something like that):

soffice -accept=socket,host=0,port=2002;urp;

and then you can query for available services:

Code: Select all

 XComponentContext xLocalContext = uno.util.Bootstrap.bootstrap();

            unoidl.com.sun.star.bridge.XUnoUrlResolver xURLResolver =
                              (unoidl.com.sun.star.bridge.XUnoUrlResolver)
                                      xLocalContext.getServiceManager().
                                               createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",
                             xLocalContext);

            unoidl.com.sun.star.uno.XComponentContext xRemoteContext =
                     (unoidl.com.sun.star.uno.XComponentContext)xURLResolver.resolve(
                              "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext");

            unoidl.com.sun.star.lang.XMultiServiceFactory xRemoteFactory =
                     (unoidl.com.sun.star.lang.XMultiServiceFactory)
                              xRemoteContext.getServiceManager();
            string[] services = xRemoteFactory.getAvailableServiceNames();
But there are a lot of services so I would appreciate some help in how to continue, I would like to do something like this:

1) Open a specific presentation file
2) Start the presentation viewer
3) Move to the next/previous slide
4) Stop the presentation

If someone has code for something like this in Java that would also be appreciated...

/Tobias