C
Cameron Sutherland
That is all the API is supposed to do. To launch that file
you have to call it based on the the path they provide. If
it is an EXE then you are laughing:
API Code...
Shell(Trim(OpenFile.lpstrFile))
The problem comes when you want them to open other
extentions. You have tell the Shell command which EXE to
use to open it with. Normally your PC goes to the registry
and looks up the extension in the HKEY_CLASSES_ROOT which
tells it where the aplicaiton registry path is which then
tells it where the EXE can be found. Hopefully you know
which file type you want them to pick so you wan't have to
do this registry searching.
Let's say you know its a MSWord file they are going to
pick. Change your sFilterto make sure they only pick Word
files:
sFilter = "Microsoft Word Files (*.doc)" & Chr(0)
& "*.DOC" & Chr(0)
Then include the already known path in your Shell command:
Shell ("C:\Progra~1\Micros~1\Office\WINWORD.EXE " & Trim
(OpenFile.lpstrFile))
-Cameron Sutherland
you have to call it based on the the path they provide. If
it is an EXE then you are laughing:
API Code...
Shell(Trim(OpenFile.lpstrFile))
The problem comes when you want them to open other
extentions. You have tell the Shell command which EXE to
use to open it with. Normally your PC goes to the registry
and looks up the extension in the HKEY_CLASSES_ROOT which
tells it where the aplicaiton registry path is which then
tells it where the EXE can be found. Hopefully you know
which file type you want them to pick so you wan't have to
do this registry searching.
Let's say you know its a MSWord file they are going to
pick. Change your sFilterto make sure they only pick Word
files:
sFilter = "Microsoft Word Files (*.doc)" & Chr(0)
& "*.DOC" & Chr(0)
Then include the already known path in your Shell command:
Shell ("C:\Progra~1\Micros~1\Office\WINWORD.EXE " & Trim
(OpenFile.lpstrFile))
-Cameron Sutherland