Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Bonjour" & vbNewLine & _
"" & vbNewLine & _
" le document vous souhaiter l'exporter a été envoyer le " & Now & " par " & Environ("UserName") & vbNewLine & vbNewLine & _
"Ce mail est généré automatiquement" & vbNewLine & _
"" & vbNewLine & _
"" & vbNewLine & _
"Veuillez ne pas repondre" & vbNewLine & _
""
' On Error Resume Next
With OutMail
.To = mail
.Cc = ""
.Bcc = ""
.Subject = nom
.Body = strbody
.Attachments.Add (sPath & sName & "\" & nom & ".doc")
'ou .display pour un envoie accepter'
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing