|
下面这段代码可以用的,但是就不能带图片发送。
能否有高人帮忙添加代码
Sub Button3_Click()
On Error Resume Next
Dim rowCount, endRowNo
Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
Dim Signature As String
endRowNo = Cells(1, 1).CurrentRegion.Rows.Count
Set objOutlook = New Outlook.Application
For rowCount = 2 To endRowNo
A = Application.WorksheetFunction.Clean(Worksheets("Sheet1").Cells(rowCount, 6))
Set objMail = objOutlook.CreateItem(olMailItem)
With objMail
.To = Cells(rowCount, 2)
.CC = Cells(rowCount, 3)
.Subject = Worksheets("Sheet1").Cells(2, 4)
.Body = Worksheets("Sheet1").Cells(2, 5)
.Attachments.Add A
.Send
End With
Set objMail = Nothing
Next
X = (endRowNo - 1) & "Sent successfully"
MsgBox X
End Sub
|
|