XL 2010 Joindre fichier EXCEL avec Outlook

  • Initiateur de la discussion Initiateur de la discussion corsu2a
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

corsu2a

XLDnaute Occasionnel
Bonjour
J'utilisais jusqu’à maintenant une macro simple qui ouvrait la fenêtre d'envoi avec la PJ, mais les gens qui n'ouvraient pas Outlook, le mail se plaçuait dans la boite d'envoi.

Inclut la PJ dans le corps du mail :
Sub envoi_mail()
'
' envoi_mail Macro
'
'
Application.Dialogs(xlDialogSendMail).Show
End Sub


Ouvre Outlook et envoie
Je dois rajouter a ma macro, l'ouverture de Outlook, j'ai cette macro mais elle ne joint pas le document excel, elle ouvre et envoi le mail sans pièces jointe. Est il possible d'integrer la macro simple

Merci pour votre aide.

Sub SendMail_Outlook()
Dim OL As Object
Dim OLmail As Object
Set OLk_Appli = CreateObject("Outlook.Application")
If OLk_Appli.Explorers.Count > 0 Then
'Ok outlook ouvert
Else
'mettre le bon chemin outlook
OLk_OK = Shell("C:\Program Files\Microsoft Office\Office16\outlook.exe", vbHide)
End If
Set OL = CreateObject("Outlook.Application")
Set OLmail = OL.CreateItem(0)
With OLmail
.To = "..............@aol.com;DDDffs@dddff.fr"
.Subject = "Feuille de garde FDF"
.Body = "azerty"
'.display
.Send
End With
Set OLmail = Nothing
Set OL = Nothing
Set OLk_Appli = Nothing
End Sub



Merci pour tout.
 
Bonjour Corsu2a

Pourquoi 2 fois " Set OLk_Appli = CreateObject("Outlook.Application") " + Shell??? 😵

En plus, il manque le chemin du fichier

VB:
Sub CommandButton()
Dim olApp As Object
Dim olMail
Dim fichier$

    Set olApp = CreateObject("Outlook.Application")
    Set olMail = olApp.CreateItem(0)
    fichier = "" 'ICI CHEMIN COMPLET DU FICHIER À ENVOYER
    With olMail
        .To = "toto@amoto.roule"
        .Subject = "Feuille de garde FDF"
        .BCC = ""
        .Body = "azerty"
        .Attachments.Add fichier
        .Display    'Pour visualiser
        '.Send      'Envois direct
    End With
    Set olMail = Nothing
    Set olApp = Nothing
End Sub

Et à combien de personne tu veux joindre le fichier? 🙄
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

  • Question Question
Microsoft 365 Code VBA
Réponses
7
Affichages
817
Réponses
4
Affichages
461
Réponses
2
Affichages
809
Retour