Hi All
I have a system that will generate an invoice by using a worksheet "Invoice" and using VBA to enter the various details. The worksheet "Invoice" is formatted with borders, left and right aligned text, emboldened text etc.
I can send this as an attachment but some recipients may not have Excel on their systems. What I would like to do is use the formatted worksheet "Invoice" as the body of an email.
After creating an invoice, I copy the "Invoice" worksheet as a stand alone workbook eg "Inv_01.xls" and I have then saved that as a webpage creating an HTML document.
Is there any way of using that HTML page as the body of an email?
I have played around with the following code but with no joy.
I set the variable MyHTMFile as the full path of my created HTML page.
Any ideas please?
Paul
I have a system that will generate an invoice by using a worksheet "Invoice" and using VBA to enter the various details. The worksheet "Invoice" is formatted with borders, left and right aligned text, emboldened text etc.
I can send this as an attachment but some recipients may not have Excel on their systems. What I would like to do is use the formatted worksheet "Invoice" as the body of an email.
After creating an invoice, I copy the "Invoice" worksheet as a stand alone workbook eg "Inv_01.xls" and I have then saved that as a webpage creating an HTML document.
Is there any way of using that HTML page as the body of an email?
I have played around with the following code but with no joy.
Code:
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = MyRecipient
.Subject = MySubject
.HTMLBody = MyHTMFile
.Send
End With
Set MailOutLook = Nothing
Set appOutLook = Nothing
I set the variable MyHTMFile as the full path of my created HTML page.
Any ideas please?
Paul