You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@openoffice.apache.org by Jörg Schmidt <jo...@j-m-schmidt.de> on 2015/03/15 15:51:46 UTC

reliably determine the location of soffice.exe

Hello,

The following code returns the directory where soffice.exe is:

Sub Benutzerverzeichnis()
 aService = CreateUnoService("com.sun.star.util.PathSubstitution") 
 sUserPath = ConvertFromURL(aService.substituteVariables("$(prog)", true))
 InputBox ("Ihr aktuelles OpenOffice.org-Benutzerverzeichnis ist:", "Benutzerverzeichnis", sUserPath)
End Sub

Unfortunately, this does not always reliable, because under OOo 3.3.0 (Win7 32Bit) I get:

C:\Program Files\OpenOffice.org 3\Basis\program

However, the soffice.exe is here:

C:\Program Files\OpenOffice.org 3\program


How can I reliably determine the location of soffice.exe?



Note:
The above code works imho correctly for AOO 4.1.1 (only tested with a server-installation) but I need a code that works for OOo 3.2.1 to AOO 4.1.1 (and, if it's possible, all LO-Versions).


Greetings,
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org