ShellExecute (sVerb, sFile, sExtraParams, sWorkingDirectory, windowstate)
Performs a "ShellExecute" function on the given file. This lets you tell the Windows shell to perform an operation on a specified file.
The nice thing about ShellExecute is that you don't need to know what specific application is registered to handle a particular type of file. For technical background information, see the "ShellExecute" function in the Windows Shell API documentation.
Parameter |
Meaning |
sVerb |
A single word that specifies the action to be taken. See the table below for possible values. |
sFile |
The filespec parameter can be any valid path. Use double quotes around complex path names with embedded spaces. It can also be the name of an executable file. |
sExtraParams |
Optional parameters: It specifies the parameters to be passed to the application that ultimately runs . The format is determined by the verb that is to be invoked, and the application that runs. |
sWorkingDir |
The working directory when the command runs. If empty, then the project home directory is used. |
windowstate |
An integer that specifies the size and state of the window that opens. Valid values are: 1 = normal, 2 = minimized, 3 = maximized. |
The sVerb parameter is a single word string that specifies the action to be taken by Shell Execute.
sVerb Value |
Meaning |
edit |
Opens an editor for the file. |
explore |
The function explores the folder specified. |
open |
The function opens the file specified. The file can be an executable file or a document file. It can also be a folder. |
|
The function prints the document file specified. If filespec is not a document file, the function will fail. |
properties |
Displays the file or folder's properties. |
find |
Launches the Find Files application found on the Start menu. |
"" (empty string) |
Ships this parameter to ShellExecute.
|
To browse a web site:
ShellExecute("open", "http://www.somedomain.com", "", "", 1)
To open a document file:
ShellExecute("open", "somefile.doc", "", "", 1)
To explore your Windows documents file folder:
ShellExecute("explore", "C :\Documents and Settings", "", "", 1)
To launch Internet Explorer:
ShellExecute("", "iexplore", "", "", 1)
To preview a file in Internet Explorer:
ShellExecute("", "iexplore somefile.htm", "", "", 1)
To search for files in the current project folder:
ShellExecute("find", filespec, "", "", 1)