I have a VBA code that works perfectly fine sending emails to a series of address list in some cells using outlook as the application. What I am trying to achieve is to automatically send a cc copy of the email to the sender. Help would be greatly appreciated. Code below
[CODE][/Sub Email_Sheet_only()
Dim oApp As Object
Dim oMail As Object
Dim LWorkbook As Workbook
Dim LFileName As String
'Turn off screen updating
Application.ScreenUpdating = False
'Copy the active worksheet and save to a temporary workbook
ActiveSheet.Copy
Set LWorkbook = ActiveWorkbook
'Create a temporary file in your current directory that uses the name
' of the sheet as the filename
LFileName = LWorkbook.Worksheets(1).Name
On Error Resume Next
'Delete the file if it already exists
Kill LFileName
On Error GoTo 0
'Save temporary file
LWorkbook.SaveAs Filename:=LFileName
'Create an Outlook object and new mail message
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(0)
'Set mail attributes (uncomment lines to enter attributes)
' In this example, only the attachment is being added to the mail message
With oMail
.To = Sheet1.Range("c62").Value & ";" & Sheet1.Range("c63").Value & ";" & Sheet1.Range("c64").Value & ";" & Sheet1.Range("c65").Value & ";" & Sheet1.Range("c66").Value & ";" & Sheet1.Range("c67").Value '& ";"
.CC = ""
.Subject = "Trying to Work - "
.Body = "To all concerned" & vbLf & _
"Kind Regards"
.Attachments.Add LWorkbook.FullName
'.Display
.send
End With
'
'
'Delete the temporary file and close temporary Workbook
LWorkbook.ChangeFileAccess Mode:=xlReadOnly
Kill LWorkbook.FullName
LWorkbook.Close SaveChanges:=False
'Turn back on screen updating
Application.ScreenUpdating = True
Set oMail = Nothing
Set oApp = Nothing
End SubCODE]
Bookmarks