escouger
XLDnaute Occasionnel
Bonjour,
J'aurai besoin d'un coup de pouce pour m'aider à trouver comment envoyer au sein d'un seul mail crée dans excel 2 fichiers attachés.
Cela marche parfaitement avec 1 seul fichier attaché mais, en en citant 2, seul le premier est envoyé.
Merci d'avance de votre aide.
GE
Voir ci-dessous mon code:
_________________________________________________________________________
Partie appelante:
messag1 = "_MAJ Planning "
messag2 = "_Envoi pour MAJ et affichages "
Nmail1 = "scaraboux@orange.fr"
Call Envoyer_Mail_Outlook(file_test_resul, file_testpdf, Nmail1)
Partie appelée:
Sub Envoyer_Mail_Outlook(Nom_Fichier, nom_fichierpdf, nmailx)
Dim ObjOutlook As New Outlook.Application
Dim oBjMail
Set ObjOutlook = New Outlook.Application
Set oBjMail = ObjOutlook.CreateItem(olMailItem)
If Nom_Fichier = "" Then Exit Sub
With oBjMail
.To = nmailx
.Subject = messag1
.Body = messag2
.Attachments.Add Nom_Fichier
.Attachments.Add nom_fichierpdf ' Ce fichier ne se retrouve pas attaché dans le mail
.Display '
.Send
End With
' ObjOutlook.Quit
Set oBjMail = Nothing
Set ObjOutlook = Nothing
End Sub
J'aurai besoin d'un coup de pouce pour m'aider à trouver comment envoyer au sein d'un seul mail crée dans excel 2 fichiers attachés.
Cela marche parfaitement avec 1 seul fichier attaché mais, en en citant 2, seul le premier est envoyé.
Merci d'avance de votre aide.
GE
Voir ci-dessous mon code:
_________________________________________________________________________
Partie appelante:
messag1 = "_MAJ Planning "
messag2 = "_Envoi pour MAJ et affichages "
Nmail1 = "scaraboux@orange.fr"
Call Envoyer_Mail_Outlook(file_test_resul, file_testpdf, Nmail1)
Partie appelée:
Sub Envoyer_Mail_Outlook(Nom_Fichier, nom_fichierpdf, nmailx)
Dim ObjOutlook As New Outlook.Application
Dim oBjMail
Set ObjOutlook = New Outlook.Application
Set oBjMail = ObjOutlook.CreateItem(olMailItem)
If Nom_Fichier = "" Then Exit Sub
With oBjMail
.To = nmailx
.Subject = messag1
.Body = messag2
.Attachments.Add Nom_Fichier
.Attachments.Add nom_fichierpdf ' Ce fichier ne se retrouve pas attaché dans le mail
.Display '
.Send
End With
' ObjOutlook.Quit
Set oBjMail = Nothing
Set ObjOutlook = Nothing
End Sub