SUB INVIO()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailAddr As String
Dim Subj As String
Dim BodyText As String
Application.ScreenUpdating = False
FILE = "C:PROVA.XLS"
Workbooks.OpenText FILE
FILEPART = ActiveWorkbook.Name
Sheets("ELENCO").Select
Sheets("ELENCO").Copy
Windows(FILEPART).Close (False)
ActiveWorkbook.SaveAs Filename:="C:PROVA2.xls"
ActiveWorkbook.Close
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
'RICHIESTA DI LETTURA EMAIL
'.ReadReceiptRequested = True
' indirizzi e-mail dei vari destinatari
.To = "XXX@XXX.IT"
' indirizzo e-mail in "Copia per Conoscenza"
' .CC =
' Eventuale e-mail in "Copia per conoscenza nascosta"
' .BCC = ""
' oggetto della e-mail
' .Subject = "XXXX"
' La colonna "D" contiene l testo della e-mail
' .Body = "PROVA INVIO"
'SE ALLEGO UN FILE
'.Attachments.Add "C:PROVA2.XLS"
'.Display
''se si vuole mandare la email in automatico togliere spunta qui sotto
'.send
End With
Set OutMail = Nothing
Set OutApp = Nothing
Kill "C:PROVA2.XLS"
END SUB |