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

How do I limit navigation options with VBA filedialog

I am trying to limit the navigation abilities of FileDialog(msoFileDialogFolderPicker).  I am setting the initialfilename to the folder I wish to start from.   I want to allow navigation to any subfolder within the initial file name, but prevent from navigating higher.   Below is a snipit of my code,  How can I restrict my navigation capabilities?  

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
fd.InitialFileName = "C:\WINDOWS\system32"
fd.Show
0
DavidWoods57017
Asked:
DavidWoods57017
3 Solutions
 
Meir RivkinFull stack Software EngineerCommented:
there's no built in mechanism in common dialog controls to restrict specific folder.
With the common dialog, you can browse any folder on any drive to which your login account has access and/or permissions.
what you can do is customize your own file dialog control which implements folder restrictions.



0
 
DavidWoods57017Author Commented:
sedqwick stated: what you can do is customize your own file dialog control which implements folder restrictions.  Can someone provide an example of customizing a a file dialog control?
0
 
Meir RivkinFull stack Software EngineerCommented:
check this post for custom dialogs tutorial:
http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=15
0
 
Jeffrey CoachmanCommented:
...Now making a custom "File Dialog" box will be even trickier...

You will somehow set a "Top" folder.

But the key lies in sedqwick's  first post:
"With the common dialog, you can browse any folder on any drive to which your login account has access and/or permissions."
So if you could restrict the users Login Access to all but your Top level folder, you may have a shot here...

What would the worse case be if a user browsed above a certain folder?

JeffCoachman
   
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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