我遇到一个难题:我用VB自动登陆163邮箱,成功了,并自动点了写信标签,现在想发信,但找不到发送标签及(收信人的地址)的HTML代码,请哪位高手能给我出个主意,谢谢!
下面是源程序Dim gj As Boolean
Sub Form_Load()
Web.Navigate "http://mail.163.com/"
'While Web.ReadyState <> 4: DoEvents:Wend
End Sub
Private Sub Web_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
On Error Resume Next 'If URL <> "" Or PostData <> "" Then SAVF URL, POSTDATE 'not is empty
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim doc As IHTMLDocument2
Dim rr As DOMChildrenCollection
On Error Resume Next
Set doc = Web.Document
Dim ctag
Dim tmp As String
If InStr(doc.nameProp, "163网易") > 0 Then '
doc.All.Item("username").focus 'id
doc.All.Item("username").Value ="XXXXX"
doc.All.Item("Password").Value = "*****"
Set ctag = doc.All.Item("登录邮箱")
If ctag.Type = "submit" Then
End If
ctag.Click
End If
If InStr(doc.nameProp, "网易电子邮箱") > 0 And gj = 0 Then
Set ctag = doc.frames(0)
Set rr = ctag.Document.All.Item("set_a_line_area3")
For i = 0 To rr.All.length - 1 '.className("gWmBtn").focus
Set ctag = rr.All(i)
If ctag.className = "gWmBtn" Then '在这是重复运行设计boon跳过
If (Not pDisp Is Web.Object) Then Exit Sub '判断当前网页是否调入完毕
ctag.Click
DoEvents
gj = True
Exit For
End If
Next
End If
End Sub
下面是源程序Dim gj As Boolean
Sub Form_Load()
Web.Navigate "http://mail.163.com/"
'While Web.ReadyState <> 4: DoEvents:Wend
End Sub
Private Sub Web_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
On Error Resume Next 'If URL <> "" Or PostData <> "" Then SAVF URL, POSTDATE 'not is empty
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim doc As IHTMLDocument2
Dim rr As DOMChildrenCollection
On Error Resume Next
Set doc = Web.Document
Dim ctag
Dim tmp As String
If InStr(doc.nameProp, "163网易") > 0 Then '
doc.All.Item("username").focus 'id
doc.All.Item("username").Value ="XXXXX"
doc.All.Item("Password").Value = "*****"
Set ctag = doc.All.Item("登录邮箱")
If ctag.Type = "submit" Then
End If
ctag.Click
End If
If InStr(doc.nameProp, "网易电子邮箱") > 0 And gj = 0 Then
Set ctag = doc.frames(0)
Set rr = ctag.Document.All.Item("set_a_line_area3")
For i = 0 To rr.All.length - 1 '.className("gWmBtn").focus
Set ctag = rr.All(i)
If ctag.className = "gWmBtn" Then '在这是重复运行设计boon跳过
If (Not pDisp Is Web.Object) Then Exit Sub '判断当前网页是否调入完毕
ctag.Click
DoEvents
gj = True
Exit For
End If
Next
End If
End Sub
解决方案 »
- 怎样将一份excel导入,然后经组合数据再导出一份新的excel!我想请教大家一下
- 关于将文本文件内容转换成字符串数组的问题
- 在activereport中打印时有一条红线(竖线),是不是红线右边的不能打印,那么怎样使他向右,使全部内容都能打印出
- 谢谢阿笨,我一天的问题解决了,终于可以休息喽,^_^
- 关于excel的单元格的合并
- 关于SourceSafe的问题
- Ask one easy Question?
- 背景图片如何随窗体的大小自动调整大小
- 怎么搞的,只能给15分了?XP下可以用vb6么?
- vb生成的exe文件不能在其他机子上运行
- type中定义控件问题
- 菜鸟问题,哪位大哥给说下这2句什么意思
163的邮箱支持smtp呀
http://www.miaomu.com