Sub WRD_Inserer_En_Tant_Qu_Objet_V2()
'code pour Microsoft Word [test OK sur mon PC]
Dim FoundFile As Variant, strClass As String, strIco As String
Dim strFullName As String, strName As String, strExt As String
Dim strPath As String
strPath = ActiveDocument.Path & "\"
With Application.FileDialog(FileDialogType:=msoFileDialogFilePicker)
If .Show = -1 Then
For Each FoundFile In .SelectedItems
strFullName = FoundFile: strName = Split(strFullName, "\")(UBound(Split(strFullName, "\")))
strExt = UCase(Right(strName, Len(strName) - InStrRev(strName, ".")))
Select Case strExt
Case "PDF"
strClass = "AcroExch.Document"
strIco = "C:\WINDOWS\Installer\{AC76BA86-1033-F400-7760-000000000003}\_PDFFile.ico"
Case "XLS", "XLSX", "XLSM"
strClass = "Excel.Sheet"
strIco = "C:\WINDOWS\Installer\{91140000-0011-0000-0000-0000000FF1CE}\xlicons.exe"
Case "DOC", "DOCX", "DOCM"
strClass = "Word.Document"
strIco = "C:\WINDOWS\Installer\{91140000-0011-0000-0000-0000000FF1CE}\wordicon.exe"
Case Else:
strClass = "Package"
strIco = "C:\WINDOWS\system32\packager.dll"
End Select
Documents.Add
ActiveDocument.Range(Start:=startRange).InlineShapes.AddOLEObject ClassType:=strClass, _
FileName:=strFullName, IconFileName:=strIco, IconIndex:=0, _
IconLabel:=strName, LinkToFile:=False, DisplayAsIcon:=True
ActiveDocument.SaveAs2 strPath & Split(strName, ".")(0) & ".docx"
ActiveDocument.Close True
Next
End If
End With 'SRC:6518_0619 - xfm(°)mpod
End Sub