View Single Post
 
Old 04-16-2015, 04:34 AM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

1. Create a text file with Notepad

Each line should have the path to the required ppt in quotes then the first slide and last slide requires separated by commas

Like this (with more lines)

"C:\Users\John\Desktop\Pres 1.pptx",1,1
"C:\Users\John\Desktop\Pres 2.pptx",2,3
etc
Save on to Desktop
2. Add & run code
Open powerpoint with a single blank slide

ALT f11 to open the vb editor
INSERT >> Module

Paste in this code (changed to point at YOUR Desktop not mine!)

Code:
Sub PasteSlides()
Dim filenum As Integer
Dim strBuffer As String
Dim rayData() As String
filenum = FreeFile
Open Environ("USERPROFILE") & "\Desktop\data.txt" For Input As filenum
While Not EOF(filenum)
        Line Input #filenum, strBuffer
        rayData = Split(strBuffer, ",")
        With ActivePresentation.Slides
        .InsertFromFile rayData(0), .Count, CLng(rayData(1)), CLng(rayData(2))
        End With
        Wend
End Sub
Hit f5 to run the code
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote