Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Online Documentation to Common Dialog ActiveX Control 1

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
I am trying to use the common dialog control to locate a folder. Could someone show me some sample code?
It will be more helpful if you can give me a link to common dialog's documentation. I looked for it in MSDN but could not find it.

Thanks.

Seaport
 
Hi, PHV,

Thanks.

Using "Shell" seems to be better than using ActiveX control. At least I do not need to add an invisible control to the form. Am I right?

Also, to use "Shell", I added a reference to "c:\windows\system32\shell32.dll." I am using windows XP. Am I doing right?

Seaport
 
Using late binding you don't need to add any reference:
Code:
Function PickFolder(strStartDir As Variant) As String
Dim SA As Object, f As Object
Set SA = CreateObject("Shell.Application")
Set f = SA.BrowseForFolder(0, "Choose a folder", 16 + 32 + 64, strStartDir)
If (Not f Is Nothing) Then
  PickFolder = f.Items.Item.path
End If
Set f = Nothing
Set SA = Nothing
End Function

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It seems that I can use "Shell" to only locate a folder. Is there a similar way to locate a file without using common dialog control?

Seaport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top