Excel VBA高级编程:用vba自动登电子邮箱的代码

发布: 2009-2-03 10:12  作者: 网络转载  查看: 1710次 共有0条评论

Excel 高级编程:用vba自动登电子邮箱的代码

 Sub Goto163()
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate ""
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 ""
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 ""
Do Until .Readystate = 4
DoEvents
Loop
On Error Resume Next
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

 

 

相关阅读
大家对 Excel VBA高级编程:用vba自动登电子邮箱的代码 的评论
最新PPT教程
最新评论
PPT问答