J'ai finalement utilisé celle-ci, qui marche super bien, un vrai plaisir !
The macro below will read each PPT file name from a list of files in LIST.TXT and for each presentation name it reads, it will insert all slides from that presentation into the current presentation. By creating the LIST.TXT file yourself, you can have the macro insert slides from presentations in multiple folders.
If the LIST.TXT file doesn't exist, the macro creates it and fills it with the names of all the files in the folder specified to by sListFilePath. (And thanks to Doug for his follow-up questions that nudged me into making this clearer.)
Sub InsertFromList()
' Inserts all presentations named in LIST.TXT into current presentation
' in list order
' LIST.TXT must be properly formatted, one full path name per line
On Error GoTo ErrorHandler
Dim sListFileName As String
Dim sListFilePath As String
Dim iListFileNum As Integer
Dim sBuf As String
' EDIT THESE AS NEEDED
' name of file containing files to be inserted
sListFileName = "LIST.TXT"
' backslash terminated path to filder containing list file:
sListFilePath = "c:\support\batchinsert\"
' Do we have a file open already?
If Not Presentations.Count > 0 Then
Exit Sub
End If
' If LIST.TXT file doesn't exist, create it
If Len(Dir$(sListFilePath & sListFileName)) = 0 Then
iListFileNum = FreeFile()
Open sListFilePath & sListFileName For Output As iListFileNum
' get file names
sBuf = Dir$(sListFilePath & "*.PPT" )
While Not sBuf = ""
Print #iListFileNum, sBuf
sBuf = Dir$
Wend
Close #iListFileNum
End If
iListFileNum = FreeFile()
Open sListFilePath & sListFileName For Input As iListFileNum
' Process the list
While Not EOF(iListFileNum)
' Get a line from the list file
Line Input #iListFileNum, sBuf
' Verify that the file named on the line exists
If Dir$(sBuf) <> "" Then
Call ActivePresentation.Slides.InsertFromFile( _
sBuf, ActivePresentation.Slides.Count)
End If
Wend
Close #iListFileNum
MsgBox "DONE!"
NormalExit:
Exit Sub
ErrorHandler:
Call MsgBox("Error:" & vbCrLf & Err.Number & vbCrLf & Err.Description, _
vbOKOnly, "Error inserting files" )
Resume NormalExit
End Sub
Source: http://www.pptfaq.com/FAQ00746_Ins [...] tation.htm
---------------
Ventes : http://forum.hardware.fr/forum2.ph [...] #t16617873