How to merge multiple powerpoint files into one file?
Yes, you can, but you can't do it with Binary Appending.
Why...??
Because a CSV is a comma separated values file, which allows data to be saved in a table structured format. CSVs look like a garden-variety spreadsheet but with a .csv extension. So when you append them, you can still use them in excel. But .pptx have different formats that are not so simple. hence Binary appending won't work.
The following code will insert all slides from all presentations in the same folder as the currently active presentation (but won't try to insert slides from the current presentation into itself). (Personally Tested)
Follow the steps:
- Create a New Folder.
For appending Mutiple Files, Save the current file in the new folder in which you want to insert slides from other files.
Copy all the other .pptx or .ppt files to the new folder Open the document in which you want to add files.
Now Press ALT+F11 to start the VBA editor.
Or choose File | Options | Customize Ribbon and put a checkmark next to Developer in the listbox under Customize Ribbon. Close the options dialog box, click the Developer tab then click Visual Basic to start the editor.
In the VBA editor, make sure that your presentation is highlighted in the left-hand pane.
Choose Insert, Module from the menu bar to insert a new code module into your project.-
Paste this Code & Change "
*.PPT
" to "*.PPTX
" or whatever if necessarySub InsertAllSlides() ' Insert all slides from all presentations in the same folder as this one ' INTO this one; do not attempt to insert THIS file into itself, though. Dim vArray() As String Dim x As Long ' Change "*.PPT" to "*.PPTX" or whatever if necessary: EnumerateFiles ActivePresentation.Path & "\", "*.PPT", vArray With ActivePresentation For x = 1 To UBound(vArray) If Len(vArray(x)) > 0 Then .Slides.InsertFromFile vArray(x), .Slides.Count End If Next End With End Sub Sub EnumerateFiles(ByVal sDirectory As String, _ ByVal sFileSpec As String, _ ByRef vArray As Variant) ' collect all files matching the file spec into vArray, an array of strings Dim sTemp As String ReDim vArray(1 To 1) sTemp = Dir$(sDirectory & sFileSpec) Do While Len(sTemp) > 0 ' NOT the "mother ship" ... current presentation If sTemp <> ActivePresentation.Name Then ReDim Preserve vArray(1 To UBound(vArray) + 1) vArray(UBound(vArray)) = sDirectory & sTemp End If sTemp = Dir$ Loop End Sub
- To make sure there are no serious syntax problems with the code, choose Debug, Compile from the menu bar.
- If there is an error check the code again, else click the Run button.
- the Slides will be added to the opened document.
NOTE : Background Pictures & some other elements are not added when slides are added from another file.
See & Learn More From :
- Insert all slides from a group of presentations into the current presentation
- How do I use VBA code in PowerPoint
Related videos on Youtube
surfmuggle
Updated on September 18, 2022Comments
-
surfmuggle over 1 year
Is there an easy way to combine multiple powerpoint files into one single file?
Under ms dos for binary files you can copy them using /b or according to this SO question just use copy
copy /b <source1> + <source2> [....] <targetfile> // or copy *.csv new.csv
I tried the later
copy *.pptx new.pptx
but this did not work - the resulting pptx was empty. The first approach usingcopy /b
requires to enter each file name which is cumbersome and i did not try.Do you have any ideas how i could sovle this?
-
AirPett almost 8 yearsIs it an option to do this by hand? Since there is a function for doing this inside PowerPoint.
-
surfmuggle almost 8 yearsDepends how comfortable it is - can i select multiple files at once or do i have to iterate the steps for each file?
-
AirPett almost 8 yearsAccording to this you have to do it manually for each file. But if you're not going to edit the big presentation after creating it, the easiest way would be to convert all files to PDF (you can find a tool that does that for 100 files automatically) and then combine those PDF-files as one big file (done that a thousand times with i.e. Adobe Acrobat)
-
-
surfmuggle almost 8 yearsThanks for your reply. In powerpoint 2013 this has to be repeated for every file. I am looking to do it in a loop for n files at once.
-
Sudipta Biswas almost 8 yearsTry the macro technique. Given at the bottom.
-
Sudipta Biswas almost 8 yearsSee I re-edited the whole thing, It works Confirmed my testing it.
-
Sudipta Biswas almost 8 yearsSee you can use this one too, But I am getting some errors while compiling it stackoverflow.com/questions/5316459/…