我使用此VBA代碼發送電子郵件,當用戶單擊一行中的單元格。如何在Excel VBA電子郵件中添加簽名?
我想添加一個帶有圖像的簽名到我的電子郵件正文。我怎樣才能修改我的代碼來放置它?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = Range("BL1").Column Then
If Target.Row > 7 And Target.Value = "Take Action" Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "<p style='font-family:calibri;font-size:16'>" & "Dear Sirs," & "<br><br>" & vbNewLine & vbNewLine & _
"F.A.O: " & "<b>" & Range("B" & ActiveCell.Row) & "</b>" & "," & vbNewLine & vbNewLine & _
"<br>" & "This is an urgent update on the status of your account." & "<br>" & vbNewLine & _
"Our records show that your insurance is due to expire on: " & "<b>" & Format(Range("BE" & ActiveCell.Row), "dd" & " Mmmm " & "yyyy") & "." & "</b>" & " To ensure that you remain active on our systems as an approved Hewden Stuart Ltd Supplier, it is important that you provide us with the details of your renewed insurance policy. Please can you provide us with these details for the following insurance as soon as possible, in order to remain active on our systems:" & vbNewLine & vbNewLine & _
"<br><br>" & "Insurance: " & "<b>" & "{Insurance Type Goes Here}" & "</b>" & "<br>" & vbNewLine & _
"Due for Period: " & "<b>" & Format(Range("BE" & ActiveCell.Row), "dd" & " Mmmm " & "yyyy") & "</b>" & " - " & "<b>" & Format(Range("BE" & ActiveCell.Row) + 365, "dd" & " Mmmm " & "yyyy") & "</b>" & vbNewLine & vbNewLine & _
"<br><br>" & "Note:" & "<br>" & vbNewLine & _
"Please ensure that the above information is provided by your insurance broker, or your insurer, in the form of a standard letter or certificate. If your insurance is in the name of a parent company, please provide a breakdown of the companies covered from your insurer. In order to provide us with the above information, please login to your Control Panel with your unique Username and Password and attach your documents. Regrettably, failure to provide us with the information requested will result in suspension of your account. If you have any queries, please email us at [email protected]" & vbNewLine & vbNewLine & _
"<br><br>" & "Your Reference:" & "<br><br>" & vbNewLine & vbNewLine & _
"<b>" & Range("AB" & ActiveCell.Row) & "</b>" & vbNewLine & _
"<p style='font-family:calibri;font-size:13'>" & "Please quote your unique Supplier Reference number when providing us with any insurance documents and in the even that you should have any enquiries." & "</p>" & vbNewLine & vbNewLine & _
"<p style='font-family:calibri;font-size:16'>" & "<br>" & "Kind Regards," & "<br><br>" & vbNewLine & vbNewLine & _
"<b>" & "Hewden Supply Chain Department" & "</b>" & "</P>"
With OutMail
.SentOnBehalfOfName = "[email protected]"
.To = "mark.o'[email protected]"
.CC = ""
.BCC = ""
.Subject = "Important! - Insurance Alert!"
.HTMLbody = strbody
.Attachments.Add ("P:\cover.jpg")
.Send 'or use .Display
End With
End If
End If
End Sub
我已經澄清了這個問題的答案。 – 2014-09-05 11:46:29