Function OutlookOuvert() As Boolean
Dim oOL As Object
On Error Resume Next
Set oOL = GetObject(, "Outlook.Application")
On Error GoTo 0
OutlookOuvert = Not (oOL Is Nothing)
Set oOL = Nothing
End Function
'--------------------------
Private Sub CommandButton2_Click()
' ceci correspond au bouton "Envoyer le message" qui ouvre et compléte Outlook
Dim PathName As String
If OutlookOuvert = False Then i = Shell("Outlook", vbNormalNoFocus)
' CHEMIN ======
NomFichierComplet = UserForm12.chemin2 & "\Bonjour XXXX.jpg"
EmbedPicture NomFichierComplet '"D:\Gestion AHI\Bonjour XXXX.jpg"
End Sub