用程序自动给下面的内容中赋值.
http://hi.baidu.com/微迈互联/boardeg:
'----------------------
Option ExplicitPrivate Sub Command1_Click()
'这里给内容中赋值
End SubPrivate Sub Form_Load()
Me.WebBrowser1.Navigate ("hi.baidu.com/微迈互联/board")
End Sub
http://hi.baidu.com/微迈互联/boardeg:
'----------------------
Option ExplicitPrivate Sub Command1_Click()
'这里给内容中赋值
End SubPrivate Sub Form_Load()
Me.WebBrowser1.Navigate ("hi.baidu.com/微迈互联/board")
End Sub
解决方案 »
- 关于十六进制单字节的加减法?
- 有点寂寞无聊,尝试放点分
- VC制作的MFC OCX控件,在VB中引用,制作VB安装程序,如何把OCX控件正确的打包进去?
- 如何用combobox连接数据库啊??我期望实现的功能如下......
- [求助]用ado访问excel,提示jet engine错误?
- 急!!急!!请教各位高手!
- 在线求一VB希尔排序算法
- 为什么报错:Combo1.Text是只读属性,如何给Combo1.Text赋值
- 如何对列表框的LIST1中内容进行排序(升或降)
- Fpsread3.0 for VB6.0 安装失败 问题是版本不兼容有解决方法吗
- 记录不能显示在mshflexgrid中
- 急 请教:怎么在lostfocus里面不能把焦点设回该项目啊?如果不行,有什么办法啊
For i = 0 To WebBrowser1.Document.All.Length - 1
If UCase(WebBrowser1.Document.All(i).tagName) = "INPUT" Then
Select Case WebBrowser1.Document.All(i).Name
Case "q"
WebBrowser1.Document.All(i).Value = "haha韓"
End Select
End If
Next
Dim Element As mshtml.IHTMLElement
docHtml = WebBrowser1.Document
Element = docHtml.getElementById("tagname")
If Not Element Is Nothing Then
Element.setAttribute("value", "UserName")
Else
Exit Function
End If你这样试一试。
Dim oDoc As HTMLDocument
Dim oInput As HTMLInputTextElement
Dim oCell As HTMLTableCell
Set oDoc = WebBrowser1.Document
Set oInput = oDoc.getElementsByTagName("INPUT").Item(3)
oInput.Value = "Hello"
Set oInput = Nothing
Set oInput = oDoc.getElementsByTagName("INPUT").Item(4)
oInput.Value = "World"
Set oInput = Nothing
Set oCell = oDoc.getElementsByTagName("TD").Item(12)
oCell.innerHTML = "Good" & oCell.innerHTML
Set oCell = Nothing
Set oInput = oDoc.getElementsByTagName("INPUT").Item(6)
oInput.Value = "Night"
Set oInput = Nothing
Set oDoc = Nothing
End SubPrivate Sub Form_Load()
WebBrowser1.Navigate ("http://hi.baidu.com/微迈互联/board")
End Sub
oCell.innerHTML = "Good" & oCell.innerHTML
Set oCell = Nothing 我用的就是这句,但就这句不行,表面上看起来是写上去了,但是提交不了。请再帮忙看一下,谢谢了
http://topic.csdn.net/u/20080310/17/b0504a99-6bcf-414d-86c6-bd6fc9dba3df.html
http://topic.csdn.net/u/20080311/12/76f9ec64-9a8f-4c90-a160-a1e97eaf315d.html
Private Sub Command1_Click()
'这里给内容中赋值
Dim webdoc As HTMLDocument
Dim Form As HTMLFormElement
Set webdoc = WebBrowser1.Document
Set Form = webdoc.Forms(0)
With Form
.Item("spBCmtAuthor").Value = "hn123 " '姓名
.Item("spBCmtURL").Value = "www.vicmiao.com" '网址或邮箱
.Item("spBCmtText").Value ="200分贴" '内容
.Item("spVerifyKey").Value ="无法识别" '验证码
'.submit '提交
End With
End Sub
.Item("spBCmtText").Value ="200分贴" '内容
这句不起做用。