LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MD MD is offline
external usenet poster
 
Posts: 26
Default Browse for folder - Jim Rech's

I'm trying to modify Jim Rech's code for Browse for Folder to give me a
spacific display. In one of his functions (code below), he sets the Desktop
as the root directory (5th line). My modification would be that a specific
directory (c:\MyDirectory\MySpecificDirrectory\). I know that we can set
the code to open in that directory, but you have all the upper folders that
makes the "folder tree" really bothersome to display since my folder is on
a network ... deep deep in my network (about 12 sub-folders deep)!! LOL

If you go in Internet Explorer, click on Favorites/Organize favorites and
click on move, you'll the same box that shows the folder without the higher
folders...

Thank you

Michel

'****This is taken from Jim Rech's Browse for Folder********
Function GetDirectory(InitDir As String, Flags As Long, CntrDlg As Boolean,
Msg) As String
Dim bInfo As BROWSEINFO
Dim pidl As Long, lpInitDir As Long

CntrDialog = CntrDlg ''Copy dialog centering setting to module level
variable so callback function can see it
With bInfo
.pidlRoot = 0 'Root folder = Desktop
.lpszTitle = Msg
.ulFlags = Flags

lpInitDir = LocalAlloc(LPTR, Len(InitDir) + 1)
CopyMemory ByVal lpInitDir, ByVal InitDir, Len(InitDir) + 1
.lParam = lpInitDir

If Val(Application.Version) 8 Then 'Establish the callback
function
.lpfn = BrowseCallBackFuncAddress
Else
.lpfn = AddrOf("BrowseCallBackFunc")
End If
End With
'Display the dialog
pidl = SHBrowseForFolder(bInfo)
'Get path string from pidl
GetDirectory = GetPathFromID(pidl)
CoTaskMemFree pidl
LocalFree lpInitDir
End Function




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browse button on form for folder path Greshter Excel Discussion (Misc queries) 2 January 12th 06 10:20 PM
Jim Rech's Browse for Folder Keb[_2_] Excel Programming 0 July 14th 04 02:53 PM
Browse for folder MD Excel Programming 1 July 13th 04 01:23 PM
Browse For Folder start directory Todd Huttenstine Excel Programming 2 May 12th 04 02:24 PM
Designate a folder as the root of the Browse tree kiwichico Excel Programming 0 October 1st 03 10:16 PM


All times are GMT +1. The time now is 09:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"