J'ai trouvé une macro excel qui permette d'envoyer des mails contenant des images via outlook, merci à l'auteur: Ron de Bruin. La macro fonctionne parfaitement mais je souhaite visualiser le mail avant de l'envoyer, j'ai donc remplacé le .Send par un .Display mais là cela ne fonctionne plus du tout!
Quelqu'un aurait-il une idée qui puisse m'éclairer?
Sub Send_Selection_Or_ActiveSheet_with_MailEnvelope()
Dim Sendrng As Range
On Error GoTo StopMacro
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Note: if the selection is one cell it will send the whole worksheet
Set Sendrng = Selection
'Create the mail and send it
With Sendrng
ActiveWorkbook.EnvelopeVisible = True
With .Parent.MailEnvelope
' Set the optional introduction field thats adds
' some header text to the email body.
.Introduction = "This is a test mail."
' In the "With .Item" part you can add more options
' See the tips on this Outlook example page.
' http://www.rondebruin.nl/mail/tips2.htm
With .Item
.Send
.To = ""
.Subject = "My subject"
End With
End With
End With
StopMacro:
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
ActiveWorkbook.EnvelopeVisible = False
End Sub