I know this may be an easy command but I can't seem to find it..
I want when a user clicks a button it opens to a folder on the hard drive(specified in the program)
thanks!
Printable View
I know this may be an easy command but I can't seem to find it..
I want when a user clicks a button it opens to a folder on the hard drive(specified in the program)
thanks!
see help and examples on
Open
Input
Close
Code:shell "explorer " & Text1.text, vbNormalFocus
You could also use the ShellExecute api function to open a folder.
Code:Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, ByVal _
nShowCmd As Long) As Long
Public Const SW_SHOWNORMAL = 1
Usage
ShellExecute Me.hwnd, vbNullString, "C:\MyFolder", _
vbNullString, "c:\", SW_SHOWNORMAL
IT's much easier just to use VB's Shell method rather than API.
Correct :)
Let's see. How shall I defend myself?
1. It may be easier, but the API function is more efficient?
2. I am always right?
3. I have no more excuses?
[/quote]
And then you have:
1. kedaman and Megatron may be absolutely right, it is much easier?
2. The dog ate it?
3. You have 1 & 2, isn't that good enough?
my 0.03ยข :rolleyes:
Hehe, technically i mean philosophically:
1. If you use shellexecute, it will open registry and get the default command line and then do 2.
2. If you use shell, then it will just run the command line (execute the app with it's parameters)
3. Or maybe it's so that shell is running shellexecute? No can't be, hehe but it's indeed in the runtimes anyway.
4. Yep Shell easiest to spell, S H E L L. no need to type E X E C U T E. + You don't need to declare anything.
5. Both does the same thing, do you see any difference?
6. I'm always right, i know all the vb answers but what was the qwestion?
A Guru with a sense of humor! Hallejuia!
I learned something new!: A Guru with a sense of humor!
That's one less person in the World that I have to worry about teaching to have a sense of humor.
Thanks kedaman, you made my night ;).
By the way, I'm always right!
I may not always give the answer needed, but I am not wrong, just :confused:confused:confused: a little :rolleyes:.