Open a folder via Command Button

  • Thread starter Thread starter Dumbfound
  • Start date Start date
D

Dumbfound

i feel helpless and ashamed to even ask this,
but how do i set a command button on a form
to simply open a folder on my hard drive?
all i want to do is open the C:\Books folder
so basically its just like a shortcut to the folder.

thanks in advance
- don't make fun of me too much :)
 
Private Sub cmdExplore_Click()
On Error GoTo Err_cmdExplore_Click

Dim stAppName As String

stAppName = "C:\WINNT\explorer.exe c:\MyFolder"
Call Shell(stAppName, 1)

Exit_cmdExplore_Click:
Exit Sub

Err_cmdExplore_Click:
MsgBox Err.Description
Resume Exit_cmdExplore_Click

End Sub
 
Back
Top