Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

FolderPicker

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roy Lasris - 06 Nov 2004 14:11 GMT
  'msoFileDialogFolderPicker' dialog seems to be the method of choice for
"folder picking" but nothing (other than sub-folders) displays in the list. I
need to be able to select a particular folder to perform a particular task, but
in order to have confidence that the right folder is being selected, the
contents of the folder needs to show. Any way to get folderpicker to display
files?

Thanks,

Roy
Steve Yandl - 06 Nov 2004 20:56 GMT
Roy,

Try this.

Open the VBE and under Tools>References check to set a reference to
"Microsoft Shell Controls and Automation".  Then build something like the
sub below.

Sub ReturnFolder()
Dim strPath As String
Dim SH As Shell32.Shell
Dim Fldr As Shell32.Folder
Set SH = New Shell32.Shell
Set Fldr = SH.BrowseForFolder(0, "Select Folder", &H4000)
If Not Fldr Is Nothing Then
FldrPath = Fldr.Items.Item.Path
End If
MsgBox FldrPath
End Sub

The "&H4000"  is going to have the dialog show the files contained in
selected folders.

Steve Yandl

>   'msoFileDialogFolderPicker' dialog seems to be the method of choice for
> "folder picking" but nothing (other than sub-folders) displays in the
[quoted text clipped - 9 lines]
>
> Roy

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.