• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

Open Folder - 500 pts

I want to allow the user to open a folder for viewing, I am currently using the BrowseInfo type. The user selects the folder but I am not sure how to call an open command on the folder.

I want the same result as typing a folder path in Start and Run.
1 Solution
Hi rocky050371,

Shell "explorer " & PathNameToFolder, vbNormalFocus

Will do it.

Tim Cottee
Or shellexecute API:

Private 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

Private Sub Command1_Click()
Call ShellExecute(0, "Open", ("C:\Somefolder"), "", "", 1)
End Sub

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now