关闭

VBA自动登陆163信箱

标签: vbabytetags
9098人阅读 评论(12) 收藏 举报
分类:

 Sub Goto163()
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "http://mail.163.com"
Do Until .Readystate = 4
DoEvents
Loop
.Document.Forms(0).All(9).Value = "myusername"
.Document.Forms(0).All(13).Value = "mypassword"
.Document.Forms(0).All(35).Click
End With
MsgBox "Ok"
End Sub

或者:

Sub Goto163()
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "http://mail.163.com"
Do Until .Readystate = 4
DoEvents
Loop
.Document.Forms(0).All("username").Value = "myusername"
.Document.Forms(0).All("password").Value = "mypassword"
.Document.Forms(0).All("登录邮箱").Click
End With
MsgBox "Ok"
End Sub

附:

Sub show163tags()
Dim i As Byte
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "http://mail.163.com"
Do Until .Readystate = 4
DoEvents
Loop
On Error Resume Next
For i = 1 To 100
If Len(.Document.Forms(0).All(i).Name) > 0 Then Debug.Print "i=" & i; "  name=" & .Document.Forms(0).All(i).Name
Next
End With
MsgBox "ok"
End Sub

返回:

i=9  name=username
i=13  name=password
i=17  name=selType
i=24  name=remUser
i=26  name=secure
i=35  name=登录邮箱
i=40  name=登录网盘
i=62  name=style
i=63  name=product

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:638664次
    • 积分:8286
    • 等级:
    • 排名:第2481名
    • 原创:205篇
    • 转载:26篇
    • 译文:1篇
    • 评论:213条
    最新评论