<< Utilities Utilities ods_getpath >>

odstoolbox >> odstoolbox > Utilities > ods_findoffice

ods_findoffice

Locate the LibreOffice or OpenOffice command-line executable "soffice"

Syntax

soffice = ods_findoffice()
[soffice, officeType] = ods_findoffice()

Arguments

soffice:

String with the full path of soffice executable, if founded

officeType:

String with the office suite ("libreoffice" or "openoffice")

Description

Search for the soffice executable of LibreOffice or OpenOffice at standard locations on Windows, GNU/Linux or macOS.

If “ods_findoffice” cannot find the program, it terminates and displays an error message and a hint what can be done if you are sure that the office suite is installed but cannot be found on the current machine.

If you are sure that LibreOffice or Apache OpenOffice is installed, create an environment variable named SOFFICE containing the full path to the soffice executable. E.g. in Windows Powershell for the current user:

[System.Environment]::SetEnvironmentVariable("SOFFICE","D:\LibreOffice\program\soffice.exe",[System.EnvironmentVariableTarget]::User)

Replace “User” with “Machine” to use a system-wide approach, or use the graphical user interface. On GNU/Linux or macOS, follow the instructions in the system documentation. After you have created or modified the SOFFICE environment variable, exit Scilab, log out of your operating system user account, and log back in before starting Scilab.

Examples

sofficepath = ods_findoffice()
[sofficepath, officeType] = ods_findoffice()

Authors


Report an issue
<< Utilities Utilities ods_getpath >>