Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default email layout

Hello to everybody
In my everyday job I need to send an excel report to my company Directors.
Reading previous posts, I arrived here
http://www.rondebruin.nl/sendmail.htm and I found some excellent VBA steps
that help to me. But I have a particular necessity I didn't find there. I
explain myself
I made these lines

Sub create_email()
Dim OutApp As Object: Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next

With OutMail
.display
.To = "
.CC = ""
.BCC = ""
.Subject = "daily report"
.body = "today feature"
.body = "1. xxxxxx "
.body = "2. yyyyyy "
.Attachments.Add ("C:\mydoc\daily report.xls")
.Send
End With
On Error GoTo 0

With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

running program as above written, I found attachement file icon at the top
side of email body, showed before the pre-formatted text ("1. xxxxxx ", "2.
yyyyyy ").
Unfortuantely I need that email layout must be like this:
_______________
1. xxxxxx (and eventually with indented point)
2. yyyyyy (and eventually with indented point)

icon file

greetings
_______________

I try to move .body before or after .attachments.add command, but the result
is always the same.
I hope to have well explained my problem and that someone can help to me.
Thanks.

Andrea.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default email layout

Hi Andrea, I had the same problem and solved it with the following:

Create your body using the string as below, this worked for me...

dim BodyText as string


BodyText = "Good Day all, " & vbNewLine & vbNewLine & _
"Please find attached the latest gAMS report." &
vbNewLine & vbNewLine & _
" • This report is for new gAMS Documents that
were not created by or allocated to ZA-T-M." & vbNewLine & vbNewLine & _
" • Please open the attachment and refer to the
UPG responsibilities per department on the right of the spreadsheet." &
vbNewLine & vbNewLine & _
" • Then check in the gAMS system to check if it
is valid for you or not, if it is valid for W.9 and you require " &
vbNewLine & _
" funds or an action, you will be required to
contact your CoC or the gAMS Prime Mover to action an AFO." & vbNewLine
& vbNewLine & vbNewLine & vbNewLine & _
"**** Should a UPG be allocated incorrectly or changed,
please advise Les Stout of the changes. ****" & vbNewLine & vbNewLine &
vbNewLine & _
"If you have any queries regarding this document, please
contact the sender." & vbNewLine & vbNewLine & vbNewLine & _
"Best Regards," & vbNewLine & vbNewLine & _
"gAMS_Auto_Macro" & vbNewLine & vbNewLine & _
"ZA-T-M-22" & vbNewLine & vbNewLine & _
"Please Note:" & vbNewLine & _
"The attachment and this e-mail are generated
automatically"

Best regards,

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Can I switch from Office 2007 layout to the old 2003 layout? samanthajade Excel Discussion (Misc queries) 3 May 11th 08 09:40 PM
how do you email a portion of a worksheet (range) as an insert into the body of an email? Bruce[_2_] Excel Programming 3 May 31st 07 10:37 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
Transfer Email addresses from spreadsheet to email address book Beana Excel Discussion (Misc queries) 2 May 30th 06 06:07 PM


All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"