Shell Function

如果需要,啟動其他應用程式並定義個別視窗樣式。

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.

note

Parameter Windowstyle is only effective on Windows systems. On other systems the parameter is ignored.


The following values are possible:

Windowstyle

Meaning

0

焦點位於隱入的程式視窗上。

Not implemented in LibreOffice.

1

焦點位於標準大小的程式視窗上。

Not implemented in LibreOffice.

2

焦點位於最小化的程式視窗上。

3

焦點位於最大化的程式視窗上。

4

標準大小的程式視窗,無焦點。

Not implemented in LibreOffice.

6

最小化的程式視窗,焦點仍位於使用中的視窗上。

Not implemented in LibreOffice.

10

全螢幕顯示。


note

Windowstyle 3 and 10 are equivalent in Windows systems.


Param

String that specifies additional arguments passed to the program.

bSync

如果將此值設定為 true (真),則 Shell 指令和所有 LibreOffice 工作都將處於等待狀態,直到 shell 程序完成為止。如果將此值設定為 false (假),shell 將直接傳回結果。標準值是 false (假)

錯誤代碼:

5 無效的程序呼叫

53 找不到檔案

73 尚未實作

Example:


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

Please support us!