Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default SendTo CSV file


I would to create a simple macro that will send a CSV file to several emai
accounts.

CSV file name and path is : C:\temp\monthcal.CSV

email accounts: ,

Thanks so much for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default SendTo CSV file


Hi Dean

Example if you use Outlook
For more code visit my site

Sub Test_Outlook()
' Is working in Office 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

strbody = "Hi there" & vbNewLine & vbNewLine & _
"This is line 1" & vbNewLine & _
"This is line 2" & vbNewLine & _
"This is line 3" & vbNewLine & _
"This is line 4"

On Error Resume Next
With OutMail
.To = , "
.CC = ""
.BCC = ""
.Attachments.Add "C:\temp\monthcal.CSV"
.Subject = "This is the Subject line"
.Body = strbody
.Send 'or use .Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Dean P." <Dean wrote in message ...

I would to create a simple macro that will send a CSV file to several emai
accounts.

CSV file name and path is : C:\temp\monthcal.CSV

email accounts: ,

Thanks so much for the help.

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
FileSendTo in 2007 Fred Smith[_4_] Excel Discussion (Misc queries) 6 March 13th 08 10:04 PM
File, SendTo, MailRecipient code MarvInBoise Excel Programming 4 June 23rd 06 08:39 PM
Sendto D Lyon - CGI Group Excel Discussion (Misc queries) 1 May 1st 06 04:48 PM
file/sendto/mailrecipient failure niuta Excel Discussion (Misc queries) 1 October 9th 05 10:32 AM
i received a file that reads powerpoint document file file exten. CCAROLACEREC Excel Discussion (Misc queries) 1 December 4th 04 05:02 PM


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

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

About Us

"It's about Microsoft Excel"