Ask Your Question
1

Get LibreOffice Version with macro

asked 2018-04-12 12:38:39 +0100

WilliamTurella gravatar image

updated 2018-04-12 13:30:10 +0100

pierre-yves samyn gravatar image

Hi, i have libre Office 6 on windows 7 x64 and i am trying to get the version of the libreoffice and whether it is x86 or x64 with basic macro on calc, but i could not find a way to do that. With the code below i can get the program version, but i also need to know if it is x86 or x64.

Sub getVersion

Dim oProdNameAccess As Object

GlobalScope.BasicLibraries.LoadLibrary("Tools")

oProdNameAccess=GetRegistryKeyContent("org.openoffice.Setup/Product")

MSGBOX oProdNameAccess.getByName("ooSetupVersion")

End sub
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-04-12 13:48:02 +0100

Lupp gravatar image

updated 2018-04-12 22:14:35 +0100

You find the wanted information, much more, and relevant links here:
https://forum.openoffice.org/en/forum...

(The macro demonstrated by Zizi64 in his first attachment there e.g. also works with LibreOffice 6.0,3.2)

Edit 1 regarding the comment by @pierre-yves samyn:
My answer was too rash. I since investigated the mentioned code and in specific the node /org.openoffice.Setup and couldn't find the bitwidth anywhere.

edit flag offensive delete link more

Comments

Hi @Lupp

I may be wrong but it seems to me that the need is not only to get the version number but to know if it's 32 or 64 bits

Regards

pierre-yves samyn gravatar imagepierre-yves samyn ( 2018-04-12 16:28:57 +0100 )edit

@pierre-yves samyn: Thanks and sorry. I obviously was too lazy to read the question completely.

Lupp gravatar imageLupp ( 2018-04-12 22:06:57 +0100 )edit

Thanks, i will take a look on openoffice forum

WilliamTurella gravatar imageWilliamTurella ( 2018-04-13 12:21:24 +0100 )edit
1

answered 2018-04-12 13:29:35 +0100

pierre-yves samyn gravatar image

Hi

This is probably not the best way to proceed but, at least with Windows you should be able to do:

dim oContext as object, sUrl as string

oContext = GetDefaultContext().getByName("/singletons/com.sun.star.util.theOfficeInstallationDirectories")
sUrl = oContext.OfficeInstallationDirectoryURL

if Instr(sUrl,"x86") > 0 then
    print "32"
else
    print "64"
end if

Regards

edit flag offensive delete link more

Comments

It's not exactly what i was looking for, but it helps a lot the code above, thenks

WilliamTurella gravatar imageWilliamTurella ( 2018-04-13 12:23:22 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-04-12 12:38:39 +0100

Seen: 108 times

Last updated: Apr 12