I use the following to load a textbox (txtFldrPath) on a userform with the
folder selected by the user when they click on a Browse button
(btnBrowseforFolder):
Private Sub btnBrowseforFolder_Click()
Dim SH As Shell32.Shell
Dim Fldr As Shell32.Folder
Set SH = New Shell32.Shell
Set Fldr = SH.BrowseForFolder(0, "Select folder in which to save the files",
&H400)
If Not Fldr Is Nothing Then
txtFldrPath.Text = Fldr.Items.Item.Path & "\"
End If
Set Fldr = Nothing
End Sub
It is necessary to have a reference set to the Microsoft Shell Controls and
Automation object library.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP