发送基于Excel的电子邮件(错误438)

时间:2015-02-10 10:26:55

标签: xml

你能帮帮我,为什么我会收到这个错误: excel宏错误438对象不支持此属性或方法 我从这个视频中得到了这段代码: https://www.youtube.com/watch?v=sIQLedQPrPs

请帮帮我

Sub SendEmail(what_address As String,subject_line As String,mail_body As String) ' ' SendEmail宏 '

' Dim olApp作为Outlook.Application 设置olApp = CreateObject(" Outlook.Application")

Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)

olMail.To = what_address
olMail.Subjeect = subject_line
olMail.Body = mail_body
olMail.Send

End Sub Sub SendMassEmail()

row_number = 1

待办事项 的DoEvents     row_number = row_number + 1     Dim mail_body_message As String     Dim ip_address As String

mail_body_message = Sheet1.Range("J2")
ip_address = Sheet1.Range("D" & row_number)
mail_body_message = Replace(mail_body_message, "ip_address", ip_address)
    MsgBox mail_body_message

'Call SendEmail(Sheet1.Range("A" & row_number), "This is a test e-mail", Sheet1.Range("J2"))

循环直到row_number = 6

MsgBox ="完成!"

End Sub

0 个答案:

没有答案