1
I did a macro where she opens the outlook, until then beauty. now I need to complement her with the following items.
I need to take 4 tabs of my spreadsheet, generate a new file and then attach in the email and send.
Someone can help me?
follows the code ( this code only opens excel )
Sub MandaEmail()
Dim EnviarPara As String
Dim Mensagem As String
For i = 1 To 1
EnviarPara = Worksheets("Tabela").Cells(5, 35)
If EnviarPara <> "" Then
Mensagem = Worksheets("Tabela").Cells(6, 35)
Texto = Worksheets("Tabela").Cells(7, 35)
Envia_Emails EnviarPara, Mensagem
End If
Next i
End Sub
Sub Envia_Emails(EnviarPara As String, Mensagem As String)
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
With OutlookMail
.To = EnviarPara
.CC = ""
.BCC = ""
.Subject = Mensagem
.Body = "Bom dia"
.Display ' para envia o email diretamente defina o código .Send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
this in hand daniel thanks for the help
– John Hebert