 | OO-Snippets: Verion of OOfficeCommons| Keywords | GetSolarVersion, Version, Configuration, ConfigurationProvider, ConfigurationAccess, createInstanceWithArguments |
|---|
| Language | OOBasic |
|---|
| Application | Office |
|---|
| Authors | Andrew Pitonyak Laurent Godard Tom Schindl
|
|---|
| Supported Versions | |
|---|
| Supported OS | |
|---|
| Question |
What version of OpenOffice.org am I running?
|
|---|
| Answer |
The GetSolarVersion() function returns an integer representing the internal
build number. Version 1.0.3.1 returns "641" and 1.1RC3 returns "645". The
following Macro by Laurent Godard uses a ConfigurationProvider to extract
the version as a text string from the XML configuration file.
|
|---|
Function OOoVersion() As String
Dim aSettings, aConfigProvider
Dim aParams2(0) As new com.sun.star.beans.PropertyValue
Dim sProvider$, sAccess$
sProvider = "com.sun.star.configuration.ConfigurationProvider"
sAccess = "com.sun.star.configuration.ConfigurationAccess"
aConfigProvider = createUnoService(sProvider)
aParams2(0).Name = "nodepath"
aParams2(0).Value = "/org.openoffice.Setup/Product"
aSettings = aConfigProvider.createInstanceWithArguments(sAccess, aParams2())
OOOVersion=aSettings.getbyname("ooSetupVersion")
End Function
|
Changelog| Date | User | Modification |
|---|
| 2004-06-22 | tomsontom | Modified to match new snippet-DTD | | 0000-00-00 | and | Initial version |
|