Whats wrong with my code? This is a real challenge...

S

Shaka215

I can't seem to figure out how to set the value of the following combo
box on the following website...

http://babelfish.altavista.com/

The combo box controls the translation language combobox and it is
called "lp" but when I refrence it in VBA I get error messages... My
code...

Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = 36 'Spanish to English
End Sub

I have also tried using the refrenced value...

Private Sub CommandButton5_Click()
WebBrowser1.Document.All("lp").value = "es_en" 'Spanish to English
End Sub

Any help is greatly appreciated!!!
 
T

Tim Williams

Try:

WebBrowser1.Document.frmTrText.lp.selectedIndex = 35 'index is zero-based

Tim
 
S

Shaka215

Try:

WebBrowser1.Document.frmTrText.lp.selectedIndex = 35  'index is zero-based

Tim










- Show quoted text -

Tim,

Thank you so much!! I would have never figured that one out. I
don't understand the logic behind the code but I know it works...

Could you please tell me where

frmTrText

came from?

Thanks again!
 
T

Tim Williams

Form elements can be referenced like this:

document.formname.elementname

frmTrText is the name of the form which contains the list.

Tim


Try:

WebBrowser1.Document.frmTrText.lp.selectedIndex = 35 'index is zero-based

Tim










- Show quoted text -

Tim,

Thank you so much!! I would have never figured that one out. I
don't understand the logic behind the code but I know it works...

Could you please tell me where

frmTrText

came from?

Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top