vba高手 vba发邮件问题
Submail()Application.ScreenUpdating=False'OnErrorResumeNextDimTempAsNewOutlook.Applic...
Sub mail()
Application.ScreenUpdating = False
' On Error Resume Next
Dim Temp As New Outlook.Application
Dim Newmail As MailItem
Dim strg As String
Set Temp = CreateObject("outlook.application")
Set Newmail = Temp.CreateItem(olMailItem)
With Newmail
.To = "2837095044@qq.com"
.CC = ""
.Subject = "<strong>EXCEL</strong>发邮件"
.Body = "EXCEL发邮件"
'.Attachments.Add ("附件所在本地地址")
.Send
End With
Application.ScreenUpdating = True
End Sub
为什么 Dim Temp As New Outlook.Application就错了 在给我看看其他错误 先跪谢了 展开
Application.ScreenUpdating = False
' On Error Resume Next
Dim Temp As New Outlook.Application
Dim Newmail As MailItem
Dim strg As String
Set Temp = CreateObject("outlook.application")
Set Newmail = Temp.CreateItem(olMailItem)
With Newmail
.To = "2837095044@qq.com"
.CC = ""
.Subject = "<strong>EXCEL</strong>发邮件"
.Body = "EXCEL发邮件"
'.Attachments.Add ("附件所在本地地址")
.Send
End With
Application.ScreenUpdating = True
End Sub
为什么 Dim Temp As New Outlook.Application就错了 在给我看看其他错误 先跪谢了 展开
3个回答
展开全部
试试
Sub mail()
Application.ScreenUpdating = False
On Error Resume Next
Dim Temp As Object
Dim Newmail As Object
Dim strg As String
Set Temp = CreateObject("outlook.application")
Set Newmail = Temp.CreateItem(0) '寻找默认的outlook
With Newmail
.To = "2837095044@qq.com"
.CC = ""
.Subject = "<strong>EXCEL</strong>发邮件"
.Body = "EXCEL发邮件"
'.Attachments.Add ("附件所在本地地址")
.Send
End With
Set Temp = Nothing
Set Newmail = Nothing
Application.ScreenUpdating = True
End Sub
Sub mail()
Application.ScreenUpdating = False
On Error Resume Next
Dim Temp As Object
Dim Newmail As Object
Dim strg As String
Set Temp = CreateObject("outlook.application")
Set Newmail = Temp.CreateItem(0) '寻找默认的outlook
With Newmail
.To = "2837095044@qq.com"
.CC = ""
.Subject = "<strong>EXCEL</strong>发邮件"
.Body = "EXCEL发邮件"
'.Attachments.Add ("附件所在本地地址")
.Send
End With
Set Temp = Nothing
Set Newmail = Nothing
Application.ScreenUpdating = True
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询