SendTo CSV file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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: (e-mail address removed), (e-mail address removed)

Thanks so much for the help.
 
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 = "(e-mail address removed), (e-mail address removed)"
.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
 

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

Back
Top