Sub piéce_jointe()
' Insérer une pièce jointe
Dim OleObj As OLEObject
Dim Fichier As Variant
Fichier = Application.GetOpenFilename("Documents pdf (*.pdf), *.pdf, Documents Word, *.doc, Documents Excel, *.xls, Documents Message, *.msg")
If Extension = ".pdf" Then
Set OleObj = ActiveSheet.OLEObjects.Add(fileName:=Fichier, _
Link:=False, DisplayAsIcon:=True, IconIndex:=0, IconLabel:="Document pdf", IconFileName:= _
"C:\WINDOWS\Installer\{AC76BA86-7AD7-1036-7B44-A80000000002}\PDFFile_8.ico")
If Extension = ".xls" Then
Set OleObj = ActiveSheet.OLEObjects.Add(fileName:=Fichier, _
Link:=False, DisplayAsIcon:=True, IconIndex:=0, IconLabel:="Document pdf", IconFileName:= _
"C:\WINDOWS\Installer\{90120409-6000-11D3-8CFE-0050048383C9}\xlicons.exe")
End If
End If
End Function