EXCEL VBA调用文件路径问题
Submail()Application.ScreenUpdating=FalseOnErrorResumeNextDimTempAsObjectDimNewmailAs...
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 = "111111@163.com"
.CC = ""
.Subject = "EXCEL发邮件"
.Body = "EXCEL发邮件"
.Attachments.Add (ThisWorkbook.Path & "\11.xls")
.Send
End With
Set Temp = Nothing
Set Newmail = Nothing
Application.ScreenUpdating = True
End Sub
=======================================
.Attachments.Add (ThisWorkbook.Path & "\11.xls")这句代码这么写对吗?
在本目录下的确存在11.xls,但邮件怎么也不出现这个附件!
求救!谢谢! 展开
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 = "111111@163.com"
.CC = ""
.Subject = "EXCEL发邮件"
.Body = "EXCEL发邮件"
.Attachments.Add (ThisWorkbook.Path & "\11.xls")
.Send
End With
Set Temp = Nothing
Set Newmail = Nothing
Application.ScreenUpdating = True
End Sub
=======================================
.Attachments.Add (ThisWorkbook.Path & "\11.xls")这句代码这么写对吗?
在本目录下的确存在11.xls,但邮件怎么也不出现这个附件!
求救!谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询