Combine many merged presentations into one
Suppose you have a situation where you've got a multi-slide template presentation that you want to merge data into, but there are multiple data sets.
For example, your template might contain:
:CompanyName: on Slide 1 :CompanyData: on Slide 2
The data file might look like:
:CompanyName: | :CompanyData: |
CompanyA | DataA |
CompanyB | DataB |
CompanyC | DataC |
You want to end up with:
CompanyA on Slide 1 DataA on Slide 2 CompanyB on Slide 3 DataB on Slide 4 CompanyC on Slide 5 DataC on Slide 6
Merge won't do this directly but if you merge your data and template together, you'll get three presentations, 1.PPT, 2.PPT and 3.PPT
Copy them all into a single folder by themselves then run the following macro, which will open the first presentation then insert the slides from each of the subsequent presentations into it, giving you one combined presentation with all of the data.
Sub CombineSlides() ' After doing the merge, open presentation #1 ' Then run this code: Dim sPath As String Dim cFileNames As New Collection Dim sTemp As String Dim x As Long sPath = CurDir ' by default If Right$(sPath, 1) <> "\" Then sPath = sPath & "\" sPath = InputBox("Path to PPT files (ex: c:\my documents\", _ "Where are the files?", sPath) If sPath = "" Then Exit Sub End If sTemp = Dir(sPath & "*.ppt") While sTemp <> "" With cFileNames .Add (sPath & sTemp) End With sTemp = Dir Wend If cFileNames.Count > 1 Then ' open the first file Presentations.Open (cFileNames(1)) ' Insert the other files For x = 2 To cFileNames.Count Call ActivePresentation.Slides.InsertFromFile( _ cFileNames(x), _ ActivePresentation.Slides.Count) Next End If End Sub[Previous] [Home] [Next]