Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HOWTO Get BrowseForFolder to work for IE

54 views
Skip to first unread message

ATS

unread,
Jul 2, 2007, 2:02:02 PM7/2/07
to
HOWTO Get BrowseForFolder to work for IE

Please help,

I'm trying to make a client side script browse for a folder. Here is what I
have so far:

=========================
<html>
<body>
<script language="javascript">
function SelectExportPath()
{
var objShell = new ActiveXObject("Shell.Application");


var iBIF_EDITBOX = 0x0010;
var iBIF_NONEWFOLDERBUTTON = 0x0200;
var objFolder;

objFolder = objShell.BrowseForFolder
(
0,
"Select Export Folder",
iBIF_EDITBOX | iBIF_NONEWFOLDERBUTTON
);

if (!IsNull(objFolder))
{
var objFolderItem = objFolder.Items.Item;
alert(objFolderItem.Path);
}
}

</script>
<input type=text id=txtExportPath style="width: 75%;"><br>
<input type=button value=" ... " onclick="SelectExportPath();"><br>
</body>
</html>
================
When I run this page the moment it tries to run the BrowseForFolder it
throws a "Permission Denied" error on the line. And this happens despite I
have trusted the web site I am launching this web page from.

Any ideas? Or alternative means to let the user select a folder?

ATS

unread,
Jul 2, 2007, 5:52:03 PM7/2/07
to
I have new information on this.

The issue is IE7 will simply NOT allow this script to run, period.

And this despite the web site being FULLY 100% - CUSTOM LEVEL trusted to
include nothing left on as "disable". And the client side user having FULL
GOD privileges over their machine. The script will only work if I run the
page as an HTA.

This is NOT acceptable.

I must have a way for a web page to run this. The page can require being
fully trusted, or the user even having admin right, that is not an issue. But
as it stands right now, IE is blocking this from running.

By the way, the page can NOT be converted as an HTA as it is generated from
ASP script.

Tim

unread,
Jul 2, 2007, 9:10:44 PM7/2/07
to
> By the way, the page can NOT be converted as an HTA as it is generated
> from
> ASP script.

How does this follow ?

http://groups.google.com/group/microsoft.public.inetsdk.programming.webbrowser_ctl/browse_thread/thread/3068d496168267a1/d9a1d7cd6a1e6aa8?lnk=st&q=%22application%2Fhta%22+mime&rnum=1&hl=en#d9a1d7cd6a1e6aa8

Tim


"ATS" <A...@discussions.microsoft.com> wrote in message
news:67FF91A8-D6B8-414F...@microsoft.com...

0 new messages