Private Sub cmdDisp_Click()
' WebBrowser1.Navigate "http://tianqi.2345.com/o/city/60508.htm"
Dim doc As IHTMLDocument2
Set doc = WebBrowser1.Document
picUpdate.Visible = True
picBack.Visible = False
Timer1.Enabled = False
'If strURL = "http://tianqi.2345.com/o/city/60508.htm" Then
'填充带输入标记的元素集合
Dim Inputs As IHTMLElementCollection
Set Inputs = doc.All.tags("INPUT")
'选择第一个输入标记
Dim Element As IHTMLElement
Set Element = Inputs.Item(0, 0)
'使用正确的界面
Dim InputElement As IHTMLInputElement
Set InputElement = Element
If InStr(txtInfo.Text, "市") <> 0 Or InStr(txtInfo.Text, "县") <> 0 Then
InputElement.value = Left(txtInfo.Text, Len(txtInfo.Text) - 1)
Else
InputElement.value = txtInfo.Text
End If
'InputElement.Value = txtInfo.Text
'调用该页第一个窗体上的提交
doc.Forms.Item(0, 0).submit
'End If
End Sub
调试错误在这里:
InputElement.value = txtInfo.Text