Selecting a choice in Drop-Down Menu

I am using Microsoft Internet Controls. After loading a webpage in it, to fill a textbox (whoami) I am using the following code...

Private Sub WebBr_DownloadComplete()
WebBr.Document.All.whoami.Value = "vshankaa"
End Sub

It is working fine, but I want to know how to select an item from a Drop-Down Menu? Say the DDM has the name "dropmenu" and has "I am a Fool" as one of its item, how to select this item?
shankaAsked:
Who is Participating?
 
EDDYKTCommented:
may be


For i = 0 To WebBr.Document.All.comboboxid.Count
If WebBr.Document.All.comboboxid.options(i).text = "I am a Fool" Then
WebBr.Document.All.comboboxid.selectedIndex = i
End If
Next
0
 
EDDYKTCommented:
EvtPerType.selectedIndex = 3

WebBr.Document.All.comboboxid.text = "I am a Fool"

or


WebBr.Document.All.comboboxid.selectedIndex = 3
0
 
shankaAuthor Commented:
WebBr.Document.All.comboboxid.text = "I am a Fool" is not working! As I don't know the index of the item I am not able to use the second method.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
shankaAuthor Commented:
The If condition part is working! But loop is not working .Count is not the right keyword.
0
 
EDDYKTCommented:
how about


For i = 0 To WebBr.Document.All.comboboxid.options.length
0
 
shankaAuthor Commented:
This is working!!!!...

For I = 0 To WebBr.Document.All.comboboxid.Options.length
    If WebBr.Document.All.comboboxid.Options(I).Text = "I am a Fool" Then
        WebBr.Document.All.comboboxid.selectedIndex = I
        Exit Sub
    End If
Next
0
 
EDDYKTCommented:
But y i only get B grade?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.