PDA

View Full Version : Creating and Formatting Body Text



brennaboy
08-18-2010, 05:10 AM
Hi,

I am using the below code to create an E-Mail from Excel.

However, I want to try and get some more information on how to format the body text. E.g. create a new line and make sure the attachement comes at the end of the body text rather than in the middle.

Are there any good resources on the net or any guidance?

Many thanks,

B.

With mpMailItem

.Subject = "This is my Subject"
.Body = "Please find attached"
.Attachments.Add "C:\MyDir\MyFile.xls"
.Display '<<< this will not send, change to .Send if required
End With

Crocus Crow
08-23-2010, 06:53 AM
Something like this:

.Body = "Line 1" & vbNewLine & "Line 2" & vbNewLine & vbNewLine & "New paragraph"

"make sure the attachment comes at the end of the body text rather than in the middle."

.Attachments.Add "C:\MyDir\MyFile.xls"

No idea on that one. Is the above line putting the attachment in the middle of the body text? For me, it puts the attachment in the 'Attach...' area between the Subject and the body text. Don't think there is a way of telling Outlook where to put the attachment.