Send email outlook from Excel text spacing new lines

dwilson38550m

Board Regular
Joined
Nov 21, 2005
Messages
89
Hi, I have a macro to send a pre-written message in the body of the email. I am using .body in the script in VBA....does anyone know how to create new lines and paragraphs in the text so it does not appear as one big long sentence. So I want it to appear in the email as


Hi

Please find attached......


If you have any queries....

Regards
X xxxx


Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
The way i have done this is to create a sheet called Text then typed the text i want in the email on every other line and added the code below into the VBA you could add as many lines as you want, the reason mine starts at B6 is because lines 1-5 are been used for other things on the text sheet

'Email message body
This should read with ab backwards arrow before body but it wont post
Body = "BODY style=font-size:11pt;font-family:Arial>" & _
Sheets("Text").Range("B6").Value & "
" & _
Sheets("Text").Range("B7").Value & "
" & _
Sheets("Text").Range("B8").Value & "
" & _
Sheets("Text").Range("B9").Value & "
" & _
Sheets("Text").Range("B10").Value & "
" & _
Sheets("Text").Range("B11").Value & "
" & _
Sheets("Text").Range("B12").Value & "


"

Hope this helps
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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