Position attachment in an e-mail

  • Thread starter Thread starter Martin
  • Start date Start date
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
 
--
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.
 
Display of attachment normally depends on the email reader, not
on the email text.

(david)
 
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
 
Back
Top