CC the Sender in VBA Code

E

Eric

I am trying to have my macro CC the sender of the excel file as an
attachment. Here is my code:

Sub Mail_workbook_Outlook_1()
Dim OutApp As Object
Dim OutMail As Object

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

On Error Resume Next
With OutMail
.To = "(e-mail address removed)"
.CC = From.Name
.BCC = ""
.Subject = ActiveWorkbook.Name
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


Again, I want to CC the sender so they have confirmation they sent the
email. Thanks!
 

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

Top