IHTMLOptionElement Object

Microsoft FrontPage Visual Basic

IHTMLOptionElement Object

IHTMLOptionElement IHTMLFormElement

Represents an OPTION element in an HTML document. The IHTMLOptionElement object provides access to a limited number of properties and methods related to the OPTION element. For access to all properties and methods, use the FPHTMLOptionElement object.

Using the IHTMLOptionElement Object

Use the options property to return an IHTMLElementCollection collection that represents a collection of all the OPTION elements in a SELECT element. Use the Item method to return an IHTMLOptionElement object that accesses a specific OPTION element, referenced by ordinal number or by the value of the id attribute. The following example accesses the first OPTION element of the first SELECT element in the active document.

    Dim objSelect As IHTMLSelectElement
Dim objOption As IHTMLOptionElement

Set objSelect = ActiveDocument.all.tags("select").Item(0)
Set objOption = objSelect.Options(0)