OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

howto retrieve openoffice version

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
grove
General User
General User


Joined: 18 Dec 2008
Posts: 6

PostPosted: Thu Dec 18, 2008 6:55 am    Post subject: howto retrieve openoffice version Reply with quote

Hi,
I'm looking for a way to discover programatically the version of openoffice (2.4 or 3.0).
Any idea?
Thanks.
Back to top
View user's profile Send private message
turtle47
Power User
Power User


Joined: 24 Aug 2008
Posts: 66
Location: Germany

PostPosted: Thu Dec 18, 2008 11:57 am    Post subject: Reply with quote

Quote:
Any idea?


Code:
Sub ShowVersionOfOOo
   m=OOoVersion()
   msgbox m
End Sub

Function OOoVersion() As String
  'Retreives the running OOO version
  'Author : Laurent Godard
  'e-mail : listes.godard@laposte.net
  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


Good luck.

JD
_________________
My Extensions
Color2Rows and LastSession
Back to top
View user's profile Send private message
grove
General User
General User


Joined: 18 Dec 2008
Posts: 6

PostPosted: Wed Jan 07, 2009 1:10 am    Post subject: Reply with quote

thank u very much!
it works good!

bye
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group