Position attachment in an e-mail

M

Martin

Hi,

I have some code that sends an e-mail perfectly well however it puts the
first line of the body text at the top, then the attachment and then any
subsequent text below.

My question is how can I ensure the attachment is at the bottom of the e-mail?

Here is the code:

Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = "[email address here]" ' This can be sourced from a form such
as Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "[Subject Here]"
.Body = "[Body Text Here]& vbCrLf & vbCrLf & "[Second line Here]"
.Attachments.Add "[File Name Here]"
.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

Thanks for your help.

Martin
 
J

Jeff C

--
Jeff C
Live Well .. Be Happy In All You Do


Martin said:
Hi,

I have some code that sends an e-mail perfectly well however it puts the
first line of the body text at the top, then the attachment and then any
subsequent text below.

My question is how can I ensure the attachment is at the bottom of the e-mail?

Here is the code:

Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = "[email address here]" ' This can be sourced from a form such
as Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "[Subject Here]"
.Body = "[Body Text Here]& vbCrLf & vbCrLf & "[Second line Here]"
.Attachments.Add "[File Name Here]"
.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

Sorry I don't have a direct solution but since you haven't heard from anyone
at this point, you might try searching through "OutlookCode.com". Wealth of
info on this site and there may be an idea for you.
 
D

david

Display of attachment normally depends on the email reader, not
on the email text.

(david)
 
M

Martin

Thanks for taking the time to respond. I will try Outlookcode.com.

Martin

david said:
Display of attachment normally depends on the email reader, not
on the email text.

(david)

Martin said:
Hi,

I have some code that sends an e-mail perfectly well however it puts the
first line of the body text at the top, then the attachment and then any
subsequent text below.

My question is how can I ensure the attachment is at the bottom of the
e-mail?

Here is the code:

Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
.To = "[email address here]" ' This can be sourced from a form such
as Me.eMailAddress
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
.Subject = "[Subject Here]"
.Body = "[Body Text Here]& vbCrLf & vbCrLf & "[Second line Here]"
.Attachments.Add "[File Name Here]"
.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

Thanks for your help.

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top