Bonjour,
Je cherche à coller un screenshot fait avec la commande CopyPicture dans le Body d'un email.
Merci de votre aide !
Pour être plus clair voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _ Cancel As Boolean) '---Message box---' Dim answer As String answer = MsgBox("Voulez-vous enregistrer le fichier", vbYesNo, "Enregistrement") If answer = vbNo Then Cancel = True If answer = vbYes Then '---Open Outlook type stuff---' Set OutlookApp = CreateObject("Outlook.Application") Set OlObjects = OutlookApp.GetNamespace("MAPI") Set Mail = OutlookApp.CreateItem(olMailItem) '---Add recipients---' Mail.Recipients.Add ("email@email.com") '---Add subject---' Mail.Subject = "Sujet du mail" '---Add body---' ActiveSheet.Range("A1:Q38").CopyPicture >>> Copie le tableau dans le presse-papier Mail.Body = >>> INSERER LE SCREENSHOT ICI<<< Mail.Display Mail.Send '---Give conformation of sent message---' MsgBox "Le fichier a bien été enregistré", , "Fichier enregistré" End If '---Save the document---' '---Me.Worksheets.Save---' End Sub
Partager