what is the code to launch a file?
Hi guys, is it possible that when command1 is pressed, it opens the file c:\test.pdf
Re: what is the code to launch a file?
Code:
Shell "Explorer " & """C:\test.pdf"""
Re: what is the code to launch a file?
Check out the "ShellExecute"-API
Re: what is the code to launch a file?
There really hasn't been a need to resort to an API Declare for some time:
Code:
'Reference to Microsoft Shell Controls and Automation,
'Shell version 5.0 or later (WinMe, Win2K, or later):
With New Shell32.Shell
.ShellExecute "C:\test.pdf" 'Additional optional arguments can be supplied.
End With
Shell.ShellExecute method
Re: what is the code to launch a file?
Quote:
Originally Posted by
dilettante
There really hasn't been a need to resort to an API Declare for some time:
Code:
'Reference to Microsoft Shell Controls and Automation,
'Shell version 5.0 or later (WinMe, Win2K, or later):
With New Shell32.Shell
.ShellExecute "C:\test.pdf" 'Additional optional arguments can be supplied.
End With
Shell.ShellExecute method
Probably because i use a TypeLib for all API's, so i don't have to reference COM-Wrappers for those like Shell.
The Win-API is kind of second nature for me (except the GDI-API's --> Grafix is just something i have two left hands :bigyello:)