BrowseFolder Options

G

Guest

Could use a little help figuring out how to modify the BrowseForFolder API so
that it does two things:

1) Preselects a path to begin in, and
2) Allows for creation of new folder

Have both Randy Birch's "callback" version and Terry Kreft's
"browseforfolder" version. Per another post, modified Terry's so that it uses

Private Const BIF_NEWDIALOGSTYLE As Long = &H40

and it works great to allow adding a new folder. Have Randy's operating so
that it allows starting in a pre-selected location, but don't know how to
combine the two.

Haven't worked much with API calls so need some help accomplishing this.
Can someone provide some guidance?

Thanks,
Bruce
 
D

Douglas J. Steele

I haven't tested, but I think that all you have to do is add a line

..ulFlags = BIF_NEWDIALOGSTYLE

inside the With BI / End With construct inside whichever of
BrowseForFolderByPath or BrowseForFolderByPIDL you're using.
 
S

Stephen Lebans

I converted those samples a while back. See:
http://www.lebans.com/callbackbrowser.htm
Functions to allow you to specify the opening folder to be displayed when
calling the Browser Folder Dialog window. Also allow you to specify position
for the standard windows File Dialog to open at:

Adapted from a sample here:

http://www.mvps.org/vbnet/index.html?code/callback/browsecallback.htm

A2KCallbackBrowse.zip - For A2K or higher

A97CallBackBrowse.zip - For A97
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

Thanks, Doug.
That, and defining the Const in modCallBacks as Public, did the trick.
Bruce

PS: Has anyone ever figured out a way to place the function in a standard
module versus the form's module, without the GPF problem?
 
G

Guest

Stephen,

Thanks for replying. I had the most recent version (re-downloaded today to
be sure) and it works beautifully. I was looking to add the "New Folder"
button to it, so I could get both the "start at this folder" and the "new
folder" functionality.

I noticed the note about GPFs. Do you think it will be OK to place the
function in the form's module and call it from a standard module, e.g.

Screen.ActiveForm.BrowseForFolderByPath([starting folder])

It works that way, but don't want to cause problems I may not be able to
figure out.

Thanks,
Bruce
 
S

Stephen Lebans

Nope, I could only get it work 100% of the time with all of the code in the
Form's module. I never looked into this issue to resolve it properly.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


BruceS said:
Stephen,

Thanks for replying. I had the most recent version (re-downloaded today
to
be sure) and it works beautifully. I was looking to add the "New Folder"
button to it, so I could get both the "start at this folder" and the "new
folder" functionality.

I noticed the note about GPFs. Do you think it will be OK to place the
function in the form's module and call it from a standard module, e.g.

Screen.ActiveForm.BrowseForFolderByPath([starting folder])

It works that way, but don't want to cause problems I may not be able to
figure out.

Thanks,
Bruce

Stephen Lebans said:
I converted those samples a while back. See:
http://www.lebans.com/callbackbrowser.htm
Functions to allow you to specify the opening folder to be displayed when
calling the Browser Folder Dialog window. Also allow you to specify
position
for the standard windows File Dialog to open at:

Adapted from a sample here:

http://www.mvps.org/vbnet/index.html?code/callback/browsecallback.htm

A2KCallbackBrowse.zip - For A2K or higher

A97CallBackBrowse.zip - For A97
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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