Hi all,
is it possible to retrieve the version of OO installed using API? Which API can I use?
Thank you!
[Solved] Retrieving OO version (OO + VB6)
-
- Posts: 15
- Joined: Thu Jul 05, 2012 2:58 pm
[Solved] Retrieving OO version (OO + VB6)
Last edited by RoryOF on Tue Aug 21, 2012 5:43 pm, edited 1 time in total.
Reason: Marked [Solved] and added green tick. [RoryOF, Moderator]
Reason: Marked [Solved] and added green tick. [RoryOF, Moderator]
OpenOffice 3.4 on Windows XP
Re: Retrieving OO version (OO + VB6)
Code: Select all
Function getOOoVersion() As String
getOOoVersion = getOOoSetupValue("/org.openoffice.Setup/Product","ooSetupVersion")
end Function
Function getOOoSetupNode(sNodePath$)
Dim aConfigProvider, oNode, args(0) As new com.sun.star.beans.PropertyValue
aConfigProvider = createUnoService("com.sun.star.configuration.ConfigurationProvider")
args(0).Name = "nodepath"
args(0).Value = sNodePath
getOOoSetupNode = aConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args())
End Function
Function getOOoSetupValue(sNodePath$,sProperty$)
Dim oNode
oNode = getOOoSetupNode(sNodePath)
getOOoSetupValue = oNode.getbyname(sProperty)
End Function
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 15
- Joined: Thu Jul 05, 2012 2:58 pm
Re: Retrieving OO version (OO + VB6)
I have found this code too and have tried to convert to VB6 but seems not to work.
This is why I'm here asking VB6 code.
This is why I'm here asking VB6 code.
OpenOffice 3.4 on Windows XP
Re: Retrieving OO version (OO + VB6)
OpenOffice does not use VB6 code. Mastering the OpenOffice API is much more complex
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Retrieving OO version (OO + VB6)
Of course you can do the same in VB6 if you know how to create the UNO service to read configuration data. If you do not know how to do that, then you can not do much with UNO without a constant flow of other people's code snippets.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 15
- Joined: Thu Jul 05, 2012 2:58 pm
Re: Retrieving OO version (OO + VB6)
Solved.
Code: Select all
Public Function VersionOO(oServiceManagerLav As Object, oDesktopLav As Object) As String
Dim oConfigProvider As Object
Dim oSettings As Object
Dim oArguments(0) As Object
Set oConfigProvider = oServiceManagerLav.createInstance("com.sun.star.configuration.ConfigurationProvider")
Set oArguments(0) = oServiceManagerLav.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
oArguments(0).Name = "nodepath"
oArguments(0).Value = "/org.openoffice.Setup/Product"
Set oSettings = oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", oArguments())
VersionOO = oSettings.getByName("ooSetupVersion")
End Function
OpenOffice 3.4 on Windows XP