LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending Email


I want to be able to send an automated email through outlook expres
which attaches an excel spreadsheet.

I have the following code which i used to use in outlook, but will no
not work in my current set up.

I've tried changing the Dim statment to look for outlook express rathe
than outlook but does not seem to like this either.

Do I need an add in to allow me to do this, or can anyone sugges
anything else

Thanks
K






Sub Send()
'Dim objOutlook As outlookexpress.Application
Dim objmessage As outlook.MailItem
Dim objAttach As outlook.Attachments

'Creates objects to send mail
Set objOutlook = CreateObject("Outlook.Application")
Set objmessage = objOutlook.CreateItem(olMailItem)
Set objAttach = objmessage.Attachments

'Loads data into fields
objmessage.To = "robert smith ; martin Gore"
objmessage.Subject = "Stock Booked in By Day (DPS Report & Re
Report)"
'This is the messgage in the body of email that recipients see
objmessage.Body = "Dear All" & Chr(13) _
& "Please find attached the files containing stock booked i
and returned by day " & Chr(13) & Chr(13) & Chr(13) _
& "Regards" & Chr(13) & Chr(13)


'Attach's file to message depending if Sunday then attach full wee
file.
'If Weekday(Now) = 1 Then
objAttach.Add "\\hmvnetapp1\data\finsys\daily\DPS Report.xls"
objAttach.Add "\\hmvnetapp1\data\finsys\daily\RET Report.xls"
'Else
'objAttach.Ad
"\\hmvnetapp1\strpublic\Finance\BaseBookingInRepor t.xls"
'End If
'Sets in expiriy time, just a housekeeping thing
objmessage.ExpiryTime = Date + 2
objmessage.Display
End Su

--
katmand
-----------------------------------------------------------------------
katmando's Profile: http://www.excelforum.com/member.php...fo&userid=2980
View this thread: http://www.excelforum.com/showthread.php?threadid=51828

 
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
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 03:44 AM
Email sending colourp Excel Discussion (Misc queries) 1 January 13th 06 01:13 AM
sending email using macros [email protected] Excel Programming 9 June 6th 05 03:13 PM
Scheduling sending an email [email protected] Excel Programming 0 April 3rd 05 09:28 AM
Sending an email Jamie Excel Programming 2 October 14th 04 02:51 PM


All times are GMT +1. The time now is 09:43 AM.

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"