Hi again

in what language do yo need it ?
I have it OOoBasic and Java

a first link in basic
http://codesnippets.services.openoffice.org/Office/Office.Version.snip

in java at the end

you may also consider using ooSetupVersionAboutBox instead of ooSetupVersion

Laurent
'---------------------------
    public String getOpenOfficeVersion(){
return getOpenOfficeProperty("org.openoffice.Setup/Product","ooSetupVersionAboutBox");
    }

    public String getOpenOfficeProperty(String nodePath, String node){
        if (!nodePath.startsWith("/")){
                nodePath = "/" + nodePath;
        }
        String property = "";
        // create the provider and remember it as a XMultiServiceFactory
        try {
final String sProviderService = "com.sun.star.configuration.ConfigurationProvider"; Object configProvider = connection.getRemoteServiceManager().createInstanceWithContext(
                        sProviderService, connection.getComponentContext());
XMultiServiceFactory xConfigProvider = (XMultiServiceFactory) UnoRuntime.queryInterface( com.sun.star.lang.XMultiServiceFactory.class, configProvider);

            // The service name: Need only read access:
final String sReadOnlyView = "com.sun.star.configuration.ConfigurationAccess";
            // creation arguments: nodepath
            PropertyValue aPathArgument = new PropertyValue();
            aPathArgument.Name = "nodepath";
            aPathArgument.Value = nodePath;
            Object[] aArguments = new Object[1];
            aArguments[0] = aPathArgument;

            // create the view
XInterface xElement = (XInterface) xConfigProvider.createInstanceWithArguments(sReadOnlyView, aArguments);
            XNameAccess xChildAccess =
(XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xElement);

            // get the value
            property = (String) xChildAccess.getByName(node);
        } catch (Exception exception){
throw new OpenOfficeException("Error retreiving property", exception);
        }
        return property;
    }




--
Laurent Godard <[EMAIL PROTECTED]> - Ingénierie OpenOffice.org - http://www.indesko.com Nuxeo Enterprise Content Management >> http://www.nuxeo.com - http://www.nuxeo.org
Livre "Programmation OpenOffice.org", Eyrolles 2004-2006

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

Reply via email to