Sub SendaMail()
Dim oAPP As Object
Dim oItem As Object
' need to declare this constant as it has no meaning without
' the reference set to the Outlook library
Const olMailItem As Long = 0
' instantiate the Application - cannot use New without a reference
' so we must use CreateObject
Set oAPP = CreateObject("Outlook.Application")
' #######################################
' NOTE: THE REST OF THE CODE IS IDENTICAL
' #######################################
' create a new email
Set oItem = oAPP.CreateItem(olMailItem)
' set basic properties and display the email
With oItem
'Destinataire :
.To = "nicolas.mechoulan@intradef.gouv.fr"
'Sujet :
.Subject = "Notre commande d'objets promotionnels "
'Copies
.CC = "nicolas.mechoulan@armeedelair.com"
'Corps du mail :
.Body = "Bonjour," & vbCrLf _
& vbCrLf _
& "Veuillez trouver ci-joint notre commande d'objets promotionnels" & vbCrLf _
& vbCrLf _
& "Respectueusement, " & vbCrLf _
.Display
'Envoi :
.Send
End With
End Sub