Macro excel envoi outlook

Sliver92 Messages postés 1 Date d'inscription   Statut Membre Dernière intervention   -  
 Tarzoon -
Bonjour,
je cherche a mettre en place une relance fournisseurs. Pour cela j'ai créer un tableau excel avec la date de facture et la date d'echéance. Je souhaiterai savoir comment créer une macro pour q'une lettre de relance soit envoyer au fournisseur par mail (outlook) a la date d'échéance si le réglement n'a pas été effectué dans les délais.
Je vous remercie pour votre aide
A voir également:

1 réponse

Tarzoon
 
Salut, voici un code que j'avais trouve ya qq tps sur le net... ce qu'il te reste a faire c recuperer les differents champs a partir de ton tableau. A+

Sub bb()
Dim objEmail As Object

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "qui envoie email"
objEmail.To = "destinateur email"
objEmail.Subject = "Sujet: balbalblaba"
objEmail.TextBody = "corp du message que vous voulez envoyez"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.AddAttachment "c:\tonfichier.txt"

objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "Utilisateur du compte"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Mot depasse"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.mail.yahoo.fr" 'Par exemple si c'est un compte yahoo
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Fields.Update

objEmail.Send
End Sub
0