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
|