Hi:

I am looking for a document describing how to manipulate
Internet Explorer objects. Right now I am facing the problem
of adding options to a SELECT drop down box in an HTML
page. I can find quite some JavaScript fragments,
such as

Code:
document.forms[0].musicType.options[3] = new Option("Folk", "folk", false, false)

for doing the above task, but I have problems finding VBscript examples.

Thanks, Erwin

----------------------------------------------------------------
Erwin Kalvelagen
GAMS Development Corp., http://www.gams.com
erwin@gams.com, http://www.gams.com/~erwin
----------------------------------------------------------------

Re: vbscript / Internet Explorer info by Robert

Robert
Sat Feb 28 16:03:55 CST 2004

It's a bit of a facetious answer but you will find many Jscript examples
because it is the best tool for the job in this instance for the same reason
that you will find most WMI examples in VBS rather than JS. Unless you know
all your web visitors will use IE you really should do this in Jscript.

Havinmg said all that I think the DOM is just as accessible to VBS as JS so
translation of jscript examples to vbs shouldn't be too difficult.

Michael Harris did something a while back that may help at

http://groups.google.co.uk/groups?q=new+select+option+vbs&hl=en&lr=&ie=UTF-8
&oe=UTF-8&selm=eL7qDQMS%24GA.294%40cppssbbsa05&rnum=6

Robert


"Erwin Kalvelagen" <erwin@gams.com> wrote in message
news:#fDEf8j$DHA.4060@TK2MSFTNGP10.phx.gbl...
>
> Hi:
>
> I am looking for a document describing how to manipulate
> Internet Explorer objects. Right now I am facing the problem
> of adding options to a SELECT drop down box in an HTML
> page. I can find quite some JavaScript fragments,
> such as
>
> Code:
> document.forms[0].musicType.options[3] = new Option("Folk", "folk", false,
false)
>
> for doing the above task, but I have problems finding VBscript examples.
>
> Thanks, Erwin
>
> ----------------------------------------------------------------
> Erwin Kalvelagen
> GAMS Development Corp., http://www.gams.com
> erwin@gams.com, http://www.gams.com/~erwin
> ----------------------------------------------------------------
>
>
>



Re: vbscript / Internet Explorer info by Michael

Michael
Sat Feb 28 16:05:39 CST 2004

> I am looking for a document describing how to manipulate
> Internet Explorer objects....


HTML and Dynamic HTML (Internet Explorer - DHTML)
http://msdn.microsoft.com/workshop/author/dhtml/dhtml_node_entry.asp


> ..., but I have problems finding VBscript
> examples.


That will always be a problem. Even in the Microsoft documentation you will
find only a few VBScript examples of client side, browser hosted script.
The reason is that only IE supports VBScript on the client. Cross browser
client script must be in J(ava)Script since that is what is supported on all
modern mainstream browsers.

You would be well served to learn JavaScript, even if your only purpose is
to be able to translate JavaScript examples into VBScript equivalents for IE
only clients.



--
Michael Harris
Microsoft.MVP.Scripting

Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

TechNet Script Center Sample Scripts
http://www.microsoft.com/technet/scriptcenter/default.asp
Download in HTML Help format (searchable)
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en


Re: vbscript / Internet Explorer info by Erwin

Erwin
Sat Feb 28 16:18:46 CST 2004


Thanks for the replies. This is basically for documentation
purposes for a COM server we developed and we have had
interest of clients to run this against VBscript. So I better
include some examples in Javascript/JScript as well as VBscript.

Thanks again.

----------------------------------------------------------------
Erwin Kalvelagen
GAMS Development Corp., http://www.gams.com
erwin@gams.com, http://www.gams.com/~erwin
----------------------------------------------------------------



Re: vbscript / Internet Explorer info by Joe

Joe
Sun Feb 29 13:37:11 CST 2004

Hi,

"Erwin Kalvelagen" <erwin@gams.com> wrote in message
news:eZquYjk$DHA.2216@TK2MSFTNGP10.phx.gbl...
>
> Thanks for the replies. This is basically for documentation
> purposes for a COM server we developed and we have had
> interest of clients to run this against VBscript. So I better
> include some examples in Javascript/JScript as well as VBscript.
>
> Thanks again.
>
> ----------------------------------------------------------------
> Erwin Kalvelagen
> GAMS Development Corp., http://www.gams.com
> erwin@gams.com, http://www.gams.com/~erwin
> ----------------------------------------------------------------

This may be too simplistic for your needs, but when I was developing IeApp
windows, I rummaged through MSDN and found examples in the newsgroup (credit
primarily posts by Michael Harris, Gurgen Alaverdian and Joe Fawcett). I
have a HTML VBS syntax htm page in my personal chm file, which I can email
you, if you wish. Information is oriented around internal (embedded) versus
external VBS script calls into the IE window, and contains information like
the following, but may be useful when converting JScript syntax.

The HTML Tag
<embedded> window.parent.document.documentElement. ...
<external> oIe.document.parentWindow.document.documentElement. ...

Properties: OnClick, OnContextmenu, OnHelp, Style.property

The Body Tag
<embedded> window.parent.document.body. ...
<external> oIe.document.parentWindow.document.body. ...

Elements/Tags with Ids
<embedded> window.id. ...
<external> oIe.document.all.id. ...

Screen Size
<embedded> window.parent.screen. ...
<external> oIe.document.parentWindow.screen. ...

Move Window Position
<embedded> window.parent.moveTo hpos, vpos
<external> oIe.document.parentWindow.moveTo hpos, vpos

HTML Event Handling
window.event. ...

WSH Event Handling
oIe.document.all.element.onEvent= getref("procedure")

WSH Calls to Embedded HTML Functions and Variables
[return=] oIe.document.all.script.function [[(]arguments[)]]
[variable=] oIe.document.all.script.variable
oIe.document.all.script.variable= value

WSH Window Configuration
oIe. ...
Properties: AddressBar, FullScreen, Height, Left, MenuBar,
Resizable, StatusBar, Toolbar, Top, Visible, Width

WSH Document Writing
oIe.document. ...
Properties and Methods: Title, Write("..."), WriteLn("...")

WSH Window Termination
oIe.quit
oIe.visible= false

Joe Earnest



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.564 / Virus Database: 356 - Release Date: 01-19-04