Article ID: 193772
Article Last Modified on 7/13/2004
* Start of code *
* Program using _ShellExecute class in _Environ library
*
* Pass in three parameters:
* tcFileName= file to open/print
* tcWorkdir = path to file
* tcOperation = what to do with the file, Open or Print
*
* Return: 2 - Bad Association (e.g., invalid URL)
* 29 - Failure to load application
* 30 - Application is busy
* 31 - No application association
*
* Values over 32 indicate success
*
LPARAMETERS tcFileName,tcWorkDir,tcOperation
tcFileName = "Test.doc"
tcWorkDir = "C:\Word" && Use appropriate directory here
tcOperation = "Print"
runapp = NEWOBJECT("_ShellExecute",HOME()+"Ffc\_Environ.vcx")
retval=runapp.ShellExecute(tcFileName,tcWorkDir,tcOperation)
IF retval <= 32
=MESSAGEBOX("ShellExecute was unsuccessful.")
ENDIF
* End of code *
You can also use the _ShellExecute Class to run another application. The
following example opens Windows Explorer:
* Start of code *
* Program using _ShellExecute class in _Environ library
tcFileName = "Explorer.exe"
tcOperation = "Open"
retval=runapp.ShellExecute(tcFileName,tcWorkDir,tcOperation)
IF retval <= 32
=MESSAGEBOX("ShellExecute was unsuccessful.")
ENDIF
* End of code *
192352 Invoke the "Open With..." Dialog Box Using ShellExecute
Additional query words: kbVFp600 kbFFC
Keywords: kbhowto kbcode KB193772