|
-
Oct 5th, 2012, 06:38 AM
#1
Thread Starter
Fanatic Member
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
-
Oct 5th, 2012, 06:47 AM
#2
Re: what is the code to launch a file?
Code:
Shell "Explorer " & """C:\test.pdf"""
-
Oct 5th, 2012, 07:28 AM
#3
Re: what is the code to launch a file?
Check out the "ShellExecute"-API
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Oct 5th, 2012, 07:52 AM
#4
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
-
Oct 5th, 2012, 08:02 AM
#5
Re: what is the code to launch a file?
 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 )
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|