\<bookmark_value\>Shell function\</bookmark_value\>

Shell Function

Starts another application and defines the respective window style, if necessary.

Syntax:

Shell (Pathname As String[, Windowstyle As Integer[, Param As String[, bSync]]])

Parameters:

Pathname

Name of the program that you want to start, optionally with complete path and/or arguments.

Windowstyle

Optional integer expression that specifies the style of the window that the program is executed in. The following values are possible:

Windowstyle

Meaning

0

The focus is on the hidden program window.

1

The focus is on the program window in standard size.

2

The focus is on the minimized program window.

3

focus is on the maximized program window.

4

Standard size program window, without focus.

6

Minimized program window, focus remains on the active window.

10

Full-screen display.


Param

String that specifies additional arguments passed to the program.

bSync

If this value is set to \<emph\>true\</emph\>, the \<emph\>Shell\</emph\> command and all LibreOffice tasks wait until the shell process completes. If the value is set to \<emph\>false\</emph\>, the shell returns directly. The default value is \<emph\>false\</emph\>.

Error codes:

5 Invalid procedure call

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err53 not found).

73 Not implemented

Example:


Sub ExampleShellForWin
    Shell("c:\windows\calc.exe",2)
End Sub

Please support us!