caro Ivair,
Este codigo abaixo já testei e funciona 100%, mas minha pergunta é como faço para cada 20 mensagens eu trocar de endereço do remetente:
Exemplo:
email_1@bol.com.br ==> até 20 mensagens
email_2@bol.com.br ==> 21 até 40 mensagens
e assim por diante...
preciso muito disso e não tenho a mínima ideia como fazer isso.
fico no aguardo,
Jorge Paulo
Private Sub Worksheet_Change(ByVal Target As Range)
Dim OutApp As Object
Dim OutMail As Object
Dim texto As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
linha = ActiveCell.Row - 1
If Target.Address = "$F$" & linha Then
If Plan1.Cells(linha, 6) = "Concluído" Then
texto = Plan1.Cells(linha, 1) & " - " & Plan1.Cells(linha, 2) & " - " _
& Plan1.Cells(linha, 3) & " - " & Plan1.Cells(linha, 4) & " - " _
& Plan1.Cells(linha, 5) & " - " & Plan1.Cells(linha, 6)
End If
With OutMail
.To = Plan1.Cells(linha, 1)
.cc = ""
.BCC = ""
.Subject = "Título do email"
.HTMLBody = texto
.Display 'Utilize Send para enviar o email sem abrir o Outlook
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End If
End Sub