Shell 函数

在需要时,启动其他应用程序并定义相应的窗口样式。

语法:

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

参数:

路径名称

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

窗口样式

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.


参数

String that specifies additional arguments passed to the program.

bSync

如果将此值设为「true」,则「Shell」命令和所有 LibreOffice 任务都将处于等待状态,直到 shell 进程结束为止。如果将它设为「false」,shell 将直接返回结果。默认值是「false」。

错误代码:

5 无效的过程调用

53 未找到文件

73 功能未实现

示例:


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

请支持我们!