View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
arjen van... arjen van... is offline
external usenet poster
 
Posts: 32
Default Attach file to e-mail using excel macro

Try something like this:

Sub NewMail()

ActiveWorkbook.EnvelopeVisible = True

Dim strAttachment As String
strAttachment = "C:\customers.txt"

With ActiveSheet.MailEnvelope
.Introduction = Range("T22")
.Item.To = Range("T15")
.Item.CC = Range("T16")
.Item.Subject = "CST CARRIERS"
.Item.Send
.Item.Attachments.Add strAttachment
End With

End Sub

Though I think creating the string variable isn't essential, you could just
put the path directly after .Add