macro 1 (sert =E0 envoyer un nouveau e-mail =E0 partir d'excel)
Dim ol As New Outlook.Application
Dim olmail As MailItem
Set ol =3D New Outlook.Application
Set olmail =3D ol.CreateItem(olMailItem)
With olmail
.To =3D Range("a3").Value
.Subject =3D Range("a6").Value
.Display
.Body =3D Range("c5").Value
.Send
End With
End sub=20
Macro 2 (sert =E0 s=E9lectionner le fichier excel et le joint=20
dans outlook)
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
papou
Bonjour Eric Comme ceci : (Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name) Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Attachments.Add (ThisWorkbook.FullName) .Send End With Set olmail = Nothing Set ol = Nothing
Cordialement Pascal
"Eric T." a écrit dans le message de news:1ffd01c3e05d$e6ec1dc0$ Bonjour,
comment faire pour combiner les deux macro ?
macro 1 (sert à envoyer un nouveau e-mail à partir d'excel)
Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Send End With End sub
Macro 2 (sert à sélectionner le fichier excel et le joint dans outlook)
Application.Dialogs(xlDialogSendMail).Show
End sub
Merci !
Eric
Bonjour Eric
Comme ceci :
(Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name)
Dim ol As New Outlook.Application
Dim olmail As MailItem
Set ol = New Outlook.Application
Set olmail = ol.CreateItem(olMailItem)
With olmail
.To = Range("a3").Value
.Subject = Range("a6").Value
.Display
.Body = Range("c5").Value
.Attachments.Add (ThisWorkbook.FullName)
.Send
End With
Set olmail = Nothing
Set ol = Nothing
Cordialement
Pascal
"Eric T." <anonymous@discussions.microsoft.com> a écrit dans le message de
news:1ffd01c3e05d$e6ec1dc0$a501280a@phx.gbl...
Bonjour,
comment faire pour combiner les deux macro ?
macro 1 (sert à envoyer un nouveau e-mail à partir d'excel)
Dim ol As New Outlook.Application
Dim olmail As MailItem
Set ol = New Outlook.Application
Set olmail = ol.CreateItem(olMailItem)
With olmail
.To = Range("a3").Value
.Subject = Range("a6").Value
.Display
.Body = Range("c5").Value
.Send
End With
End sub
Macro 2 (sert à sélectionner le fichier excel et le joint
dans outlook)
Bonjour Eric Comme ceci : (Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name) Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Attachments.Add (ThisWorkbook.FullName) .Send End With Set olmail = Nothing Set ol = Nothing
Cordialement Pascal
"Eric T." a écrit dans le message de news:1ffd01c3e05d$e6ec1dc0$ Bonjour,
comment faire pour combiner les deux macro ?
macro 1 (sert à envoyer un nouveau e-mail à partir d'excel)
Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Send End With End sub
Macro 2 (sert à sélectionner le fichier excel et le joint dans outlook)
Application.Dialogs(xlDialogSendMail).Show
End sub
Merci !
Eric
papou
Heu...
(Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name) ThisWorkbook.FullName
Pardon
Cordialement Pascal
"papou" <nspm> a écrit dans le message de news:
Bonjour Eric Comme ceci : (Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name) Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Attachments.Add (ThisWorkbook.FullName) .Send End With Set olmail = Nothing Set ol = Nothing
Cordialement Pascal
"Eric T." a écrit dans le message de news:1ffd01c3e05d$e6ec1dc0$ Bonjour,
comment faire pour combiner les deux macro ?
macro 1 (sert à envoyer un nouveau e-mail à partir d'excel)
Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Send End With End sub
Macro 2 (sert à sélectionner le fichier excel et le joint dans outlook)
Application.Dialogs(xlDialogSendMail).Show
End sub
Merci !
Eric
Heu...
(Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name)
ThisWorkbook.FullName
Pardon
Cordialement
Pascal
"papou" <nspm> a écrit dans le message de
news:O5BZMlL4DHA.2432@TK2MSFTNGP09.phx.gbl...
Bonjour Eric
Comme ceci :
(Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name)
Dim ol As New Outlook.Application
Dim olmail As MailItem
Set ol = New Outlook.Application
Set olmail = ol.CreateItem(olMailItem)
With olmail
.To = Range("a3").Value
.Subject = Range("a6").Value
.Display
.Body = Range("c5").Value
.Attachments.Add (ThisWorkbook.FullName)
.Send
End With
Set olmail = Nothing
Set ol = Nothing
Cordialement
Pascal
"Eric T." <anonymous@discussions.microsoft.com> a écrit dans le message de
news:1ffd01c3e05d$e6ec1dc0$a501280a@phx.gbl...
Bonjour,
comment faire pour combiner les deux macro ?
macro 1 (sert à envoyer un nouveau e-mail à partir d'excel)
Dim ol As New Outlook.Application
Dim olmail As MailItem
Set ol = New Outlook.Application
Set olmail = ol.CreateItem(olMailItem)
With olmail
.To = Range("a3").Value
.Subject = Range("a6").Value
.Display
.Body = Range("c5").Value
.Send
End With
End sub
Macro 2 (sert à sélectionner le fichier excel et le joint
dans outlook)
(Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name) ThisWorkbook.FullName
Pardon
Cordialement Pascal
"papou" <nspm> a écrit dans le message de news:
Bonjour Eric Comme ceci : (Attention, aucun test n'est effectué sur la valeur de ThisWorkbook.Name) Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Attachments.Add (ThisWorkbook.FullName) .Send End With Set olmail = Nothing Set ol = Nothing
Cordialement Pascal
"Eric T." a écrit dans le message de news:1ffd01c3e05d$e6ec1dc0$ Bonjour,
comment faire pour combiner les deux macro ?
macro 1 (sert à envoyer un nouveau e-mail à partir d'excel)
Dim ol As New Outlook.Application Dim olmail As MailItem Set ol = New Outlook.Application Set olmail = ol.CreateItem(olMailItem) With olmail .To = Range("a3").Value .Subject = Range("a6").Value .Display .Body = Range("c5").Value .Send End With End sub
Macro 2 (sert à sélectionner le fichier excel et le joint dans outlook)