第76集 IE与网络操作
363、 网络资源下载
Private Declare PtrSafe Function URLDownloadToFile Lib “urlmon” Alias “URLDownloadToFileA” (ByVal pCaller As LongLong, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As LongLong, ByVal lpfnCB As LongLong) As LongLong
Private Sub Form_Load()
Dim url As String, path As String, isdown As LongLong
url = “http://pandownload.club/dl/PanDownload_v2.0.9.zip” '下载链接
path = ThisWorkbook.path & “\PanDownload_v2.0.9.zip” '存放全路径
isdown = URLDownloadToFile(0, url, path, 0, 0)
If isdown = 0 Then
MsgBox “下载成功”
Else
MsgBox “下载失败”
End If
End Sub
364、 发送邮件
Sub 邮件发送()
On Error Resume Next
Dim cm As New CDO.Message
'Set cm = CreateObject(“CDO.Message”) '创建对象 '引用路径:C:\Windows\system32\cdosys.dll
cm.From = “13525226@qq.com” '设置发信人的邮箱"
cm.To = “3474584848
VBA入门到进阶常用知识代码总结76
最新推荐文章于 2020-11-28 16:40:23 发布