Have been setting up an automated bid request and purchase order matrix. All is working well. However, I want to tighten up the style and professionalism of the auto response email in hopes of keeping the automated email out of people's spam filters. I think the problem would be solved if I could get my outlook to add in my standard email siganture onto the email before being sent. Does anyone know if this is an excell VBA issue or an Outlook issue? I have tried solving it from the Outlook side with little success.
If it is an excel VBA coding issue, does anyone know how to stylistically program in a formatted email signature (color, bold, etc...) into the macro? Code is as follows:
If it is an excel VBA coding issue, does anyone know how to stylistically program in a formatted email signature (color, bold, etc...) into the macro? Code is as follows:
VBA Code:
Public Sub Save_Range_As_PDF_and_Send_Email_PO()
Dim PDFrange As Range
Dim PDFfile As String
Dim toEmail As String, emailSubject As String
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim HTMLBody As String
With ActiveWorkbook
Set PDFrange = .ActiveSheet.Range("A1:I53")
toEmail = .ActiveSheet.Range("B15").Value
emailSubject = .ActiveSheet.Range("C6").Value
PDFfile = Replace(.FullName, ".xlsx", ".pdf")
End With
PDFrange.ExportAsFixedFormat Type:=xlTypePDF, Filename:=PDFfile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
'Send email with PDF file attached
Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = toEmail
.Subject = emailSubject
.HTMLBody = "<p> Hello, </p>" & _
"<p> Please see attached purchase order. We are happy to connect to discuss an missing details. </p>" & _
"<p> Thank you, </p>" & _
"<p> rdc Procurement. </p>"
.Attachments.Add PDFfile
.send
End With
'Delete the temporary PDF file
Kill PDFfile
Set OutMail = Nothing
Set OutApp = Nothing
End Sub