Preciso de código para enviar e-mail através do Outlook com um anexo através de uma macro do Excel. Por favor, ajudem?
Private Sub CommandButton10_Click()
Dim OutApp As Object
Dim OutMail como Object
Dim strbody As String
Set OutApp = CreateObject
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail:
.Para = "me@here.com"
.CC = ""
.BCC = ""
.Assunto = "Arquivo para #" & Chr(32) & Range("H4") & "foi atualizado."
.Corpo = "Por favor, revisão." & vbCrLf & vbCrLf & ActiveWorkbook.FullName
.Enviar
.ReadReceiptRequested = True
End With
Terminar com
On Error Goto 0
Set OutMail = Nothing
Set OutApp = Nothing
Dim Msg, Style, Title
Msg = "E-mail foi enviado" & Chr (13) & Chr (10) & "Pressione OK para continuar."
Estilo = vbOKOnly + vbInformation
Title = "Lista de questões em aberto"
Resposta = MsgBox (Msg, Estilo, Título, Ajuda, Ctxt)
End Sub.