473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Folder Open

553 512MB
I have this code to open Folder view. I am not sure how to retreive name and path of the selected folder and assign it to a variable (string type) ..Help please


Expand|Select|Wrap|Line Numbers
  1. Public shlShell As Shell32.Shell
  2. Public shlFolder As Shell32.Folder
  3. Const BIF_RETURNONLYFSDIRS = &H1
  4.  
  5. Public Sub Command2_Click()
  6.  
  7. Set shlShell = New Shell32.Shell
  8. Set shlFolder = shlShell.BrowseForFolder(Me.Hwnd, "Select a Folder", BIF_RETURNONLYFSDIRS)
  9. End Sub
  10.  
Aug 2 '07 #1
1 2336
MikeTheBike
639 Expert 512MB
Hi
I have this code to open Folder view. I am not sure how to retreive name and path of the selected folder and assign it to a variable (string type) ..Help please


Expand|Select|Wrap|Line Numbers
  1. Public shlShell As Shell32.Shell
  2. Public shlFolder As Shell32.Folder
  3. Const BIF_RETURNONLYFSDIRS = &H1
  4.  
  5. Public Sub Command2_Click()
  6.  
  7. Set shlShell = New Shell32.Shell
  8. Set shlFolder = shlShell.BrowseForFolder(Me.Hwnd, "Select a Folder", BIF_RETURNONLYFSDIRS)
  9. End Sub
  10.  
Do you need to use the shell ?

Perhaps you could use the FileDialogue

Expand|Select|Wrap|Line Numbers
  1. Dim fd As FileDialog
  2.     Set fd = Application.FileDialog(msoFileDialogFolderPicker)
  3.     With fd
  4.         .Show
  5.         If .SelectedItems.Count <> 0 Then MsgBox .SelectedItems(1)
  6.     End With
??

You will need a reference to Microsoft Office Object Library

Just a thought

MTB
Aug 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Yuri Vorontsov | last post by:
Hallo! We have troubles (post XP SP2) to open local folders from the web application: - the web application allows users to select a local file (input type=file) - the system DOES NOT upload...
7
by: Tom | last post by:
Can anyone give me any advice on how to secure a folder on a network server so that documents in the folder can only be opened through an Access database or by the database admin. I need to store...
2
by: Stan | last post by:
My project folder path is c:\Projects\FinWeb. I set up FinWeb virtual folder in IIS and pointed it to that path. I can access the web site via http://localhost/FinWeb. However, when I try to add...
4
by: santel_helvis | last post by:
Hi there, I wanna open the folder using asp.net. I am using anchor link to do that. But in href part how shall I give the location. Anyone plz help me out. Thanks in advance
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
1
by: halcyon943 | last post by:
have 4 folders that I watch and need to move files from to another location. Three constraints: -Finish time. Make sure the program stops transferring files at a specific time -Number of...
2
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
I made a typo on a Project name (e.g. Wong, instead of Wang). Later on I renamed the Soution, Project, WebForm., etc, except the file folder name, back to Wang. Then after I closed the VS.net and...
14
by: pamela fluente | last post by:
I want to use the ordinary OpenFileDialog to choose a folder instead of a file. Is it possible? And how? -P
5
by: Sin Jeong-hun | last post by:
Hello. Speical folders, like Desktop, usually have different display names. For example, in Japanese Windows, it's displayed as "$B%G%9%/%H%C%W(B". I want to get the this displayed name of a...
9
by: Keith G Hicks | last post by:
I'm having a lot of trouble with "file in use" errors in my "folder watcher" project. Starting and stopping the watcher and reading my XML file work fine. Once the watcher is started, I'm reading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.