Re: Can't Get Open/SaveAs Dialogs
- From: Five By Five <5x5@xxxxxxx>
- Date: Thu, 18 Sep 2008 09:36:02 -0700
"Anthony Jones" <AnthonyWJones@xxxxxxxxxxxxxxxx> wrote in
microsoft.public.scripting.jscript:
"Five By Five" <5x5@xxxxxxx> wrote in message
news:Xns9B1D576A846F85x55x5@xxxxxxxxxxxxxxxx
"Anthony Jones" <AnthonyWJones@xxxxxxxxxxxxxxxx> wrote in
microsoft.public.scripting.jscript:
"Five By Five" <5x5@xxxxxxx> wrote in message
news:Xns9B1C8F94B3A5F5x55x5@xxxxxxxxxxxxxxxx
I would like to be able to use JScript interface to call and
manipulate Open and Save/As file dialog windows.
The application is in a heavily scripted web document to be run in
IE, and the script will interact with the local filesystem for
reading and writing text and possibly binary files. I don't think
there should be no security issues.
However, I am not able to construct an ActiveX object. From stuff
I found on the web to be able to use open/save-as dialogs:
var dlg = new ActiveXObject("MSComDlg.CommonDialog");
and
var dlg = new ActiveXObject("UserAccounts.CommonDialog");
generates the error "Automation Server can't create object" and
execution in the MS Script Debugger halts at that line.
I am looking for a definitive reference producing the desired
constructed object as well as what the methods and
gettable/settable properties are, including accepted property
values/ranges.
Browser = IE 7+
OS = Vista Home Premium
You need this HTM page to be a HTA instead.
http://msdn.microsoft.com/en-gb/library/ms536471(vs.85).aspx
File re-naming in this manner managed to change only one thing. The
call to the constructor:
var dlg = new ActiveXObject("MSComDlg.CommonDialog");
now reports the error "The control cannot be created because it is
not properly licensed"
The other call reports the "Auto.. Server can't create object error".
I am not sure why Microsoft makes it so purposely difficult to call
its user interface. Difficult in many respects, including and
especially finding documentation to how to use its interface.
MSComDlg is not actually part of the OS but is part of the
redistributable components of a number of its development platforms
such as VB6. Hence it is not expected or supported that these
components be used from script.
So then, for an Open File dialog box, the scripter would have to write his
own library code using core JScript calls to create a dialog-like window,
populating the folder items (presumably using the FileSystemObject to
retrieve entries in the designated/current directory) in a scrollable list
box somehow, with a dropdown control showing directory hierarchy, a
textbox control with the filename entry, Open and Cancel button controls,
with the look and styling clearly not consistent with a system look and
feel?
.
- Follow-Ups:
- Re: Can't Get Open/SaveAs Dialogs
- From: Anthony Jones
- Re: Can't Get Open/SaveAs Dialogs
- References:
- Can't Get Open/SaveAs Dialogs
- From: Five By Five
- Re: Can't Get Open/SaveAs Dialogs
- From: Anthony Jones
- Re: Can't Get Open/SaveAs Dialogs
- From: Five By Five
- Re: Can't Get Open/SaveAs Dialogs
- From: Anthony Jones
- Can't Get Open/SaveAs Dialogs
- Prev by Date: Re: Cross browser problems
- Next by Date: Re: Cross browser problems
- Previous by thread: Re: Can't Get Open/SaveAs Dialogs
- Next by thread: Re: Can't Get Open/SaveAs Dialogs
- Index(es):
Relevant Pages
|