Enviar E-mail via Excel [RESOLVIDO]

Fabio Trindade

26-11-2011 19:03:21

Boa tarde, galera.

Estou com duvidas sobre enviar e-mail atraves do excel, parcialmente consegui adaptar a macro mas não quero anexar a planilha para enviar e sim quero colar algumas celulas da planilha direto no corpo do e-mail, o máximo que consegui foi, colocar Para, Cc, Assunto e Algumas Palavras no corpo do e-mail e nada mais, toda ideia e bem vinda.

Segue o codigo que estou usando:

Código: Selecionar todos

Sub Envio_Email()

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
  
With myItem
    .To = "teste@hotmail.com"
    .Cc = "teste@hotmail.com"
    .Subject = "Teste Envio de E-mail"
    .Body = "Bom dia, Sr(ª)"
    .Save
    .Send
End With

End Sub

Mauro Coutinho

27-11-2011 10:08:25

Fabio, eu não utilizo enviar email pelo excel, mas no site abaixo tem esta rotina, veja se seria isto:

Como enviar um intervalo de células em uma mensagem de email usando o Visual Basic for Applications no Excel
http://support.microsoft.com/kb/816644

Código: Selecionar todos

Sub Send_Range()
   
   ' Select the range of cells on the active worksheet.
   ActiveSheet.Range("A1:B5").Select
   
   ' Show the envelope on the ActiveWorkbook.
   ActiveWorkbook.EnvelopeVisible = True
   
   ' Set the optional introduction field thats adds
   ' some header text to the email body. It also sets
   ' the To and Subject lines. Finally the message
   ' is sent.
   With ActiveSheet.MailEnvelope
      .Introduction = "This is a sample worksheet."
      .Item.To = "E-Mail_Address_Here"
      .Item.Subject = "My subject"
      .Item.Send
   End With
End Sub
Naõ cheguei a testar, faça os testes e qq duvida retorne.

[]s

Fabio Trindade

29-11-2011 23:26:07

Mauro Coutinho,

Mais uma vez obrigado, pela ajuda ... esta funcionando a macro que vc postou era isso mesmo que estava procurando fiz alguns teste e deu certo, muito obrigado !!!

jefferson1208

28-08-2018 12:43:53