Browsing for a folder - cracked it! 
Author Message
 Browsing for a folder - cracked it!

VERY COOL!!!
Thanks for posting

Regards,
Ian Morrish
http://www.*-*-*.com/ WSHFAQ
http://www.*-*-*.com/ (NetMeeting)
http://www.*-*-*.com/

Quote:
>Finally I found a solution to this! The script attached uses a dialog
>similar to the CommonDialog "Open File" dialog to allow you to browse the
>directory tree for a particular folder. It uses the Microsoft Internet
>Controls ("Shell.Application").

>There are still some issues I'm aware of; it won't handle pure UNC paths
>(\\computer\share), and I don't know how it behaves on Win95 or on a
machine
>without IE4 installed. I'm sure it can still be refined and improved in
many
>ways.

>Any feedback? I'd particularily like to hear if it doesn't work on your
>system.
>Cheers,
>Sen Hennessy



Sat, 10 Mar 2001 03:00:00 GMT  
 Browsing for a folder - cracked it!
I tried it on Win95 and IE4.

Essentially it works. Browsefolder has a 4th option to set the
rootdirectory.

The only  problem that I found with your script is that when I press the
cancel button it
always returns the path to the desktop ('C:\WINDOWS\DESKTOP').

Gr.

Dirk.

Sean Hennessy heeft geschreven in bericht

Quote:
>Finally I found a solution to this! The script attached uses a dialog
>similar to the CommonDialog "Open File" dialog to allow you to browse the
>directory tree for a particular folder. It uses the Microsoft Internet
>Controls ("Shell.Application").

>There are still some issues I'm aware of; it won't handle pure UNC paths
>(\\computer\share), and I don't know how it behaves on Win95 or on a
machine
>without IE4 installed. I'm sure it can still be refined and improved in
many
>ways.

>Any feedback? I'd particularily like to hear if it doesn't work on your
>system.
>Cheers,
>Sen Hennessy



Sat, 10 Mar 2001 03:00:00 GMT  
 Browsing for a folder - cracked it!
Ah yes, the cancel button... I suspect that this behaviour can be controlled
using the long passed as argument 3, the way you can control elements of the
common dialog using its Flags property.

By trial and error I found that &h1 greyed out the OK button when an invalid
folder like "My Computer" is selected. There must be many others, including
one to determine the action of the Cancel button, but they don't seem to be
defined as constants - I looked using in the VB object browser.

What I'd really like is for the cancel button to return Null. Anybody know
about this?

Thanks for the feedback!
Sen Hennessy


Quote:
>I tried it on Win95 and IE4.

>Essentially it works. Browsefolder has a 4th option to set the
>rootdirectory.

>The only  problem that I found with your script is that when I press the
>cancel button it
>always returns the path to the desktop ('C:\WINDOWS\DESKTOP').

>Gr.

>Dirk.

>Sean Hennessy heeft geschreven in bericht

>>Finally I found a solution to this! The script attached uses a dialog
>>similar to the CommonDialog "Open File" dialog to allow you to browse the
>>directory tree for a particular folder. It uses the Microsoft Internet
>>Controls ("Shell.Application").

>>There are still some issues I'm aware of; it won't handle pure UNC paths
>>(\\computer\share), and I don't know how it behaves on Win95 or on a
>machine
>>without IE4 installed. I'm sure it can still be refined and improved in
>many
>>ways.

>>Any feedback? I'd particularily like to hear if it doesn't work on your
>>system.
>>Cheers,
>>Sen Hennessy



Sat, 10 Mar 2001 03:00:00 GMT  
 Browsing for a folder - cracked it!
I have replaced a couple of input boxes with your script, and it really
works nice.  Only tried on Win98 so far.  Thanks for the code.

Pete Nicholls

Quote:
>Finally I found a solution to this! The script attached uses a dialog
>similar to the CommonDialog "Open File" dialog to allow you to browse the
>directory tree for a particular folder. It uses the Microsoft Internet
>Controls ("Shell.Application").



Sat, 10 Mar 2001 03:00:00 GMT  
 Browsing for a folder - cracked it!
The BrowseForFolder is excellent!

For lack of any other ideas (and little documentation) you could just grab
the error message on the way back.  If cancel is chosen the line...

    BrowseForFolder = objFolder.ParentFolder.ParseName(objFolder.Title).Path

returns err.number 424..."Object Required".  if err.number = 424 then
BrowseForFolder = null  Exit function.

Very cheesy but it does seem to work.


Quote:
>Ah yes, the cancel button... I suspect that this behaviour can be
controlled
>using the long passed as argument 3, the way you can control elements of
the
>common dialog using its Flags property.
>snip



Sat, 10 Mar 2001 03:00:00 GMT  
 Browsing for a folder - cracked it!
Sean,

I looks like if the user clicks Cancel, the statement "If objFolder is
Nothing Then" will be true.

Hope that helps...

 - Joel


Quote:
>Ah yes, the cancel button... I suspect that this behaviour can be
controlled
>using the long passed as argument 3, the way you can control elements of
the
>common dialog using its Flags property.

>By trial and error I found that &h1 greyed out the OK button when an
invalid
>folder like "My Computer" is selected. There must be many others, including
>one to determine the action of the Cancel button, but they don't seem to be
>defined as constants - I looked using in the VB object browser.

>What I'd really like is for the cancel button to return Null. Anybody know
>about this?

>Thanks for the feedback!
>Sen Hennessy



>>I tried it on Win95 and IE4.

>>Essentially it works. Browsefolder has a 4th option to set the
>>rootdirectory.

>>The only  problem that I found with your script is that when I press the
>>cancel button it
>>always returns the path to the desktop ('C:\WINDOWS\DESKTOP').

>>Gr.

>>Dirk.

>>Sean Hennessy heeft geschreven in bericht

>>>Finally I found a solution to this! The script attached uses a dialog
>>>similar to the CommonDialog "Open File" dialog to allow you to browse the
>>>directory tree for a particular folder. It uses the Microsoft Internet
>>>Controls ("Shell.Application").

>>>There are still some issues I'm aware of; it won't handle pure UNC paths
>>>(\\computer\share), and I don't know how it behaves on Win95 or on a
>>machine
>>>without IE4 installed. I'm sure it can still be refined and improved in
>>many
>>>ways.

>>>Any feedback? I'd particularily like to hear if it doesn't work on your
>>>system.
>>>Cheers,
>>>Sen Hennessy



Tue, 20 Mar 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Browse for folder

2. Browse for folder

3. Browse for folder, open/save file

4. Browse.WshKit Won't Work On Folders Names with Spaces

5. browse for folder or file

6. Browse folder path

7. Browse for folder?

8. Browsing for a folder

9. Browse for folder?

10. Browse for Folder C drive

11. Browsing Outlook folders with Windows Scripting

12. browse for folder or file

 

 
Powered by phpBB® Forum Software