Promotic
WikipediaLinkedInYoutubeTwitterFacebook

ShellExecute - method of object Pm

Description:
Running or printing the file or the registered document.
Syntax:
ShellExecute(sOperation As String, sFile As String, sParameters As String, sFolder As String, nShow As Long) As Long
Calling:
n = Pm.ShellExecute(sOperation, sFile, sParameters, sFolder, nShow)
Parameters:
sOperation(String) Type of operation with the file. If the parameter is empty text, then the value "open" is set.
"open" - The file has to be opened along with the associated application
"print" - The file has to be printed
sFile(String) file name (with the path). If a full path is not entered, it is completed relatively according to the application file folder.

It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.

sParameters(String) Parameters that have to be passed to the application associated to the running file
sFolder(String) Path to the working folder of the application.

It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.

nShow(Long) Display mode of the application associated to the file:
0 - hidden
1 - normal active
2 - minimized active
3 - maximized active
4 - normal not active
6 - minimized not active
Return Values:
If the operation passed successfully, the method returns the value 0, otherwise it returns the error number:
1 - out of memory
3 - the specified file has not been found
4 - the specified path has not been found
Note:
The method serves to running or printing a *.exe file or the file that is registered in the OS Windows along with the associated application.
 
This method is not functional for Web Panels.
Example1:
Print the text document "experiment.htm" in the Internet Explorer:
Pm.ShellExecute "print", "#app:experiment.htm", "", "#app:", 0
Example2:
Display of the Windows system window for the network printer "\\SERVER\PRINTER1:"
Pm.ShellExecute "", "\\SERVER\PRINTER1", "", "", 0
Example3:
Launching the PowerPoint application.
Pm.ShellExecute "open", "c:\Proj\presentation.pps", "", "c:\Proj\", 1
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- ShellExecute
 
 
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice