Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Jacques93
Bonjour ROLLOT Pascal Jean, ROLLOT Pascal Jean a écrit :
Bonjour,
Quelqu'un pourrait -il me dire où est l'erreur dans ce code qui est supposé envoyer un mail avec 2 pièces jointes?
Si quelqu'un a un code qui fonctionne cela serait super.
Merci d'avance et bonne journée.
Dim NomDoc(3) As String NomDoc(1) = "c:testtoto.pdf" NomDoc(2) = "c:testtiti.pdf" MAPISession1.SignOn With MAPIMessages1
.MsgIndex = -1 .SessionID = MAPISession1.SessionID .RecipDisplayName = " " 'Destinataire .MsgSubject = "Réclamation" 'Objet '.AttachmentPathName = "c:testtoto.pdf" For i = 1 To 2 .AttachmentIndex = i - 1 ' .AttachmentPosition = i - 1 .AttachmentPathName = NomDoc(i) Next i .MsgNoteText = "Envoi Numéro unique" 'Texte .Send End With MAPISession1.SignOff
Voir ici :
<http://support.microsoft.com/kb/q186148/>
L'élément important semble être au niveau de MsgNoteText :
... 'The value 2 is passed to the Space() function in the 'next line because there are two attachments to add. 'These spaces act as placeholders for the attachments. .MsgNoteText = _ Space(2) & vbCrLf & _ "This message was sent from the MSMAPI32.OCX." & vbCrLf & _ "This message contains 2 attachments." ...
-- Cordialement,
Jacques.
Bonjour ROLLOT Pascal Jean,
ROLLOT Pascal Jean a écrit :
Bonjour,
Quelqu'un pourrait -il me dire où est l'erreur dans ce code qui est supposé
envoyer un mail avec 2 pièces jointes?
Si quelqu'un a un code qui fonctionne cela serait super.
Merci d'avance et bonne journée.
Dim NomDoc(3) As String
NomDoc(1) = "c:testtoto.pdf"
NomDoc(2) = "c:testtiti.pdf"
MAPISession1.SignOn
With MAPIMessages1
.MsgIndex = -1
.SessionID = MAPISession1.SessionID
.RecipDisplayName = "toto@wanadoo.fr " 'Destinataire
.MsgSubject = "Réclamation" 'Objet
'.AttachmentPathName = "c:testtoto.pdf"
For i = 1 To 2
.AttachmentIndex = i - 1
' .AttachmentPosition = i - 1
.AttachmentPathName = NomDoc(i)
Next i
.MsgNoteText = "Envoi Numéro unique" 'Texte
.Send
End With
MAPISession1.SignOff
Voir ici :
<http://support.microsoft.com/kb/q186148/>
L'élément important semble être au niveau de MsgNoteText :
...
'The value 2 is passed to the Space() function in the
'next line because there are two attachments to add.
'These spaces act as placeholders for the attachments.
.MsgNoteText = _
Space(2) & vbCrLf & _
"This message was sent from the MSMAPI32.OCX." & vbCrLf & _
"This message contains 2 attachments."
...
Bonjour ROLLOT Pascal Jean, ROLLOT Pascal Jean a écrit :
Bonjour,
Quelqu'un pourrait -il me dire où est l'erreur dans ce code qui est supposé envoyer un mail avec 2 pièces jointes?
Si quelqu'un a un code qui fonctionne cela serait super.
Merci d'avance et bonne journée.
Dim NomDoc(3) As String NomDoc(1) = "c:testtoto.pdf" NomDoc(2) = "c:testtiti.pdf" MAPISession1.SignOn With MAPIMessages1
.MsgIndex = -1 .SessionID = MAPISession1.SessionID .RecipDisplayName = " " 'Destinataire .MsgSubject = "Réclamation" 'Objet '.AttachmentPathName = "c:testtoto.pdf" For i = 1 To 2 .AttachmentIndex = i - 1 ' .AttachmentPosition = i - 1 .AttachmentPathName = NomDoc(i) Next i .MsgNoteText = "Envoi Numéro unique" 'Texte .Send End With MAPISession1.SignOff
Voir ici :
<http://support.microsoft.com/kb/q186148/>
L'élément important semble être au niveau de MsgNoteText :
... 'The value 2 is passed to the Space() function in the 'next line because there are two attachments to add. 'These spaces act as placeholders for the attachments. .MsgNoteText = _ Space(2) & vbCrLf & _ "This message was sent from the MSMAPI32.OCX." & vbCrLf & _ "This message contains 2 attachments." ...