Browse for path (not file)

B

Brian

I use the comdlg32 API call for locating files, particularly back-end MDB's
in order to refresh the table links.

I now have a need to browse just for a path (not a file) and populate a text
box with the path. I can't figure out how to browse for just the path without
the file.

Here is the function declaration line at the beginning of my code (followed
by lots of lines of stuff that's mostly Greek to me but works to return the
file path & name)

Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

So, where do I start if I want to capture a path via the browse, but not a
file.
 
S

strive4peace

Hi Brian,

API BrowseFolder Dialog, by KenGetz
http://www.mvps.org/access/api/api0002.htm

but I like to use the code to get a file and parse the filename chosen
out (of course, this means that there must be a file to pick in the
directory) because you cannot specify a starting directory with BrowsePath

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
R

RoyVidar

strive4peace said:
Hi Brian,

API BrowseFolder Dialog, by KenGetz
http://www.mvps.org/access/api/api0002.htm

but I like to use the code to get a file and parse the filename
chosen out (of course, this means that there must be a file to pick
in the directory) because you cannot specify a starting directory
with BrowsePath

Within the link you gave, check out the link in the "Stephen Lebans has
added functionality to open the browse folder at a specific place."
paragraph.
Remote Programming and Training
strive4peace2006 at yahoo.com

Have you considered your sig vs
"Advertising/Solicitation: These communities were created as a forum
for
providing peer-to-peer assistance on Microsoft products and services.
We
ask that you refrain from posting advertisements or solicitations that
do not pertain directly to the intended use and purpose of the
newsgroup
or chat."
http://msdn.microsoft.com/library/gallery/components/wn/2/locales/help_en-US.htm#RulesofConduct

Aren't you advertising your services, here? Why not just link to your
website?
 
J

John Spencer

Sir,
I think that those two lines are acceptable. They identify the email
address of the person and a very brief synopsis of her
qualifications/interest. I don't see how that is any more of a solicitation
than posting a URL to a website.

If the poster had said, email me for a quote on solving your problem - that
would have be solicitation. Also, if the poster had just posted an offer of
services and a description of the available services, that would have been
out of bounds.
 
B

Brian

Thank you. That did it nicely.

strive4peace said:
Hi Brian,

API BrowseFolder Dialog, by KenGetz
http://www.mvps.org/access/api/api0002.htm

but I like to use the code to get a file and parse the filename chosen
out (of course, this means that there must be a file to pick in the
directory) because you cannot specify a starting directory with BrowsePath

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
S

strive4peace

thank you, Brian ;) happy to help

my apologies, the BrowseFolder Dialog code was written by Terry
Kreft*... and, as Roy pointed out (thank you, Roy), there is a link in
that URL (.../api/api0002.htm) to some code written by Stephen Lebans
that lets you specify a starting directory if you discover that you want
that (and also cursor coordinates for the dialog box if you want ;) )

here is Leban's link for reference
http://www.lebans.com/callbackbrowser.htm

FYI:
Ken Getz wrote the FileOpen Dialog that uses a Windows API at
http://www.mvps.org/access/api/api0001.htm

www.mvps.org
especially <g>
www.mvps.org/access

are excellent resources as well as Leban's site (and his books are good
too!)

*without these shoulders to stand on, we couldn't be giants ;)



Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
strive4peace2006 at yahoo.com
*
 
S

strive4peace

thank you, John!

I had no idea anything might be out of line, but, never-the-less, I have
mailed Eric( my MVP lead) to ask...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
strive4peace2006 at yahoo.com
*



John said:
Sir,
I think that those two lines are acceptable. They identify the email
address of the person and a very brief synopsis of her
qualifications/interest. I don't see how that is any more of a solicitation
than posting a URL to a website.

If the poster had said, email me for a quote on solving your problem - that
would have be solicitation. Also, if the poster had just posted an offer of
services and a description of the available services, that would have been
out of bounds.
 
S

strive4peace

Hi Roy,

firstly, thanks for pointing out that the BroweFolder code by Terry
Kreft, http://www.mvps.org/access/api/api0002.htm
has a link to Leban's URL! I didn't notice it ... and that is so nice
to know!

I am checking on your second question and will put my siggy back with
official approval, it never occurred to me... in the future, please feel
free to send me email

....I am a fairly new MVP and still learning...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
strive4peace2006 at yahoo.com
*
 
R

RoyVidar

strive4peace said:
Hi Roy,

firstly, thanks for pointing out that the BroweFolder code by Terry
Kreft, http://www.mvps.org/access/api/api0002.htm
has a link to Leban's URL! I didn't notice it ... and that is so
nice to know!

I am checking on your second question and will put my siggy back with
official approval, it never occurred to me... in the future, please
feel free to send me email

...I am a fairly new MVP and still learning...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
strive4peace2006 at yahoo.com
*

Yes - sometiems, when encountering the lack of such feature in apps,
when you know that the app "knows" the initial directory, can be a bit
frustrating ;-)

Thank you!
 

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