OVH Cloud OVH Cloud

Pièces jointes

1 réponse
Avatar
Charlie
Bonjour à tous,

Dans mon applic Excel, j'ai trouvé une procédure qui me permet d'envoyer un
classeur par e-mail. Mais je ne trouve pas le moyen pour l'envoyer avec
plusieurs documents en pièces jointes.

Private Sub EnvoiMail(strEMail)
Dim objOutlook As Object
Dim objOutlookMsg As Object
Dim objOutlookRecip As Object
Dim wbk As Workbook

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
.Recipients.Add strEMail
.Subject = "Test Sub"
.Body = "Body test" & vbCrLf & vbCrLf
.attachments.Add "LePremierClasseur.xls"
.Send
End With

'cleanup
Set objOutlook = Nothing
Set objOutlookMsg = Nothing
Set objOutlookRecip = Nothing
Set wbk = Nothing

End Sub

1 réponse

Avatar
Charlie
J'avais oublié !

Merci pour votre aide
Charlie



"Charlie" wrote in message
news:
Bonjour à tous,

Pour mon applic Excel, j'ai trouvé une procédure qui me permet d'envoyer
un

classeur par e-mail. Mais je ne trouve pas le moyen pour l'envoyer avec
plusieurs documents en pièces jointes.

Private Sub EnvoiMail(strEMail)
Dim objOutlook As Object
Dim objOutlookMsg As Object
Dim objOutlookRecip As Object
Dim wbk As Workbook

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
.Recipients.Add strEMail
.Subject = "Test Sub"
.Body = "Body test" & vbCrLf & vbCrLf
.attachments.Add "LePremierClasseur.xls"
.Send
End With

'cleanup
Set objOutlook = Nothing
Set objOutlookMsg = Nothing
Set objOutlookRecip = Nothing
Set wbk = Nothing

End Sub