Adding multiple Ranges from Excel to an Outlook Email

Papa_Don

New Member
Joined
Jan 22, 2015
Messages
38
Hi Group,

I'm attempting to add two Excel ranges to the body of an email. I've figured out how to do one. But I'm now having to modify my script to show two. Here is the code I've written:

With OutMail
.To = emailAdd
.CC = ""
.BCC = ""
.Subject = "Corporate Transient Accept Rate Audit " & auditDate & " / " & propName & " (#" & propID & ")"
.HTMLBody = "<BODY style=font-size:11pt;font-family:Calibri>" & greeting & "<br><br>" & _
paragraph1 & "<br><br>" & _
paragraph2 & "<br><br>" & _
paragraph3 & "<br><br>" & _
paragraph4 & "<br><br>" & _
"<span style=""background-color: #FFFF00""><b>" & paragraph5 & "</b></span>" & "<br><br>" & _
"<strong><span style=""text-decoration:underline;"">" & "Lanyon Submit Audit Results:" & "</span></strong><br>"

' Here is where the fail starts:


RangetoHTML2 (rng2) & _
"<br><br>" & _
"<strong><span style=""text-decoration:underline;"">" & "Lanyon Accept Audit Results:" & "</span></strong><br>"

' this ends the yellow highlighted area (above). I suspect the area below will error for the same reason.


RangetoHTML1 (rng1) & "<br><br>" & _
Signature & "</BODY>"
.Display
End With

Is there an appropriate way to code this to insert two ranges into the body of the email?

In advance, thanks for your help.

Don
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,215,043
Messages
6,122,825
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top