I'm am trying to write vba code to fill out web-forms and click buttons for me. I am looping through the various option
tags on the page to select the one I want. When I reach it, I want to select it, but I'm not sure of the syntax.
Dim htmlO As HTMLOptionElement
For Each htmlO In Object.getElementByTagName("option")
If Trim(htmlO.value) = "INS" Then
htmlO.???? (click? select?)
Exit For
End If
Next
Here is the HTML from the webpage:
<select gtbfieldid="40" id="menu" name="pv_choice">
<option selected="selected" value="ZZZ">Choose Menu Option
</option><option value="BL_COMP">Blanket Companies
</option><option value="CARR_SEARCH">Carrier Search
</option><option value="PASSWORD">Change Password
</option><option value="FED_REG">FMCSA Register
</option><option value="FEEDBACK">Feedback
</option><option value="HOME">Home Page
</option><option value="INS">Insurance Filing
</option><option value="OOS_LIST">Out Of Service Carriers
</option></select>
I want to select the option "INS".