sempre in riferimento all'invio di mail volevo chiedervi come fare per aggiungere nel corpo del messaggio il riferimento ad una cella specifica.
l'inserimento nell'oggetto l'abbiamo risolto nel topic http://www.pc-facile.com/forum/viewtopic.php?f=26&t=106732&p=624954&hilit=+mail#p624954, ora avrei bisogno che la seguente istruzione che si trova nel "Subj" fosse inserita nel corpo della mail
- Codice: Seleziona tutto
Intestato a : " & Cells(I, 2).Value & " " & Cells(I, 3).Value & " - " & Cells(I, 4).Value
vi allego la macro:
- Codice: Seleziona tutto
Option Explicit
Sub Invio_Email()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailAddr As String
Dim Subj As String
Dim BDT As String
Dim UR As Integer, I As Integer
UR = Sheets("Foglio1").Range("I2").End(xlDown).Row
Set OutApp = CreateObject("Outlook.Application")
BDT = "Gentile Cliente,"
For I = 2 To UR
EmailAddr = Range("I" & I).Value
'Subj = "MANCATO RECAPITO "
Subj = "MANCATO RECAPITO : Cliente n° " & Cells(I, 1).Value & " Intestato a : " & Cells(I, 2).Value & " " & Cells(I, 3).Value & " - " & Cells(I, 4).Value
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = EmailAddr
.CC = ""
.BCC = ""
.Subject = Subj
.Body = BDT
' .Display 'or use .Send
.Send
End With
'Application.Wait (Now + TimeValue("0:00:04")) ' <<==== Vedi se 4 secondi possono essere portati a 1
'Application.SendKeys "%a"
Application.Wait (Now + TimeValue("0:00:02")) ' <<==== Vedi se 4 secondi possono essere portati a 1
Next I
MsgBox "Effettuato invio di " & UR - 1 & " e-mail ", vbInformation
Set OutMail = Nothing
Set OutApp = Nothing
End Sub