Finding a Folder with VBA

J

JBNewsGroup

Hi,

I am assuming that this is the correct group to ask my question. If not
please be kind and point me to the right group.

I want to find a Folder and its path. I do not know any of the file names
in the folder. However, I do know the UserName and FolderName. What I am
trying to do is get a folder name such as:

C:\ <something> \ UserName \ <something> \ FolderName

with only the UserName and FolderName known. How do you find the fully
qualified path to the Folder?

Any help or suggestions would be greatly appreciated. I have searched all
over and cannot seem to find an answer.

Thanks in advance for solutions and / or suggestions.

Jerry Bodoff
 
J

Jean-Guy Marcil

JBNewsGroup was telling us:
JBNewsGroup nous racontait que :
Hi,

I am assuming that this is the correct group to ask my question. If
not please be kind and point me to the right group.

I want to find a Folder and its path. I do not know any of the file
names in the folder. However, I do know the UserName and FolderName.
What I am trying to do is get a folder name such as:

C:\ <something> \ UserName \ <something> \ FolderName

with only the UserName and FolderName known. How do you find the fully
qualified path to the Folder?

Any help or suggestions would be greatly appreciated. I have
searched all over and cannot seem to find an answer.

Thanks in advance for solutions and / or suggestions.

Have you looked up the SeachFolder collection in the online Word VBA help?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

JBNewsGroup

Hi Jean-Guy,

Thanks.

I read the MSDN Library document and there seems to be a problem. First off
I am on WORD 2000 and do not have Office XP. Also, I am sharing this with
one other person and loading code is out of the question (I am not even sure
I should load it). The big problem is that the folder FolderName may be
empty (no files). Do you have another idea?

Jerry Bodoff
 
J

JBNewsGroup

Hi Jean-Guy,

I think I solved my problem. Thanks for making me aware of the
SearchFolders.

I am putting my solution here in case someone else has the same kind of
problem and wants to use my solution.

I created a folder C:\<app>Ini. I have a little "setup" form which creates
an Ini file called <user><app>.Ini in this folder. The form uses
BrowseForFolder and the resulting path that is returned is written to the
user's Ini file.

Once again thanks for your help.

Jerry Bodoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top