Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-09-2015, 09:44 AM
rain264 rain264 is offline How Do I Pull Slides from Multiple Files Windows 2K How Do I Pull Slides from Multiple Files Office 2013
Novice
How Do I Pull Slides from Multiple Files
 
Join Date: Apr 2015
Posts: 3
rain264 is on a distinguished road
Talking How Do I Pull Slides from Multiple Files


Hello - I have a "deck" that is built weekly. Currently, I have to go into multiple files and copy from each file and paste into the weekly deck. How can I set it up so that every week, it can be pulled and updated automatically.
Thanks for any assistance!
Reply With Quote
  #2  
Old 04-12-2015, 08:13 PM
excelledsoftware excelledsoftware is offline How Do I Pull Slides from Multiple Files Windows 7 64bit How Do I Pull Slides from Multiple Files Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Do you want every slide from all of these other files to end up in the weekly deck presentation?
Reply With Quote
  #3  
Old 04-13-2015, 01:53 AM
JohnWilson JohnWilson is offline How Do I Pull Slides from Multiple Files Windows 7 64bit How Do I Pull Slides from Multiple Files Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

You will really need to use code to do this.

Try this:

Create a text file that looks like this

Path to each file, first slide to add, last slide to add each on a new line

"C:\Users\John\Desktop\Pres 1.pptx",1,1
"C:\Users\John\Desktop\Pres 2.pptx",2,3
etc

Then run this code (get back if you don't know how)

Code:
Sub PasteSlides()
Dim filenum As Integer
Dim strBuffer As String
Dim rayData() As String
filenum = FreeFile
' change to your text file location
Open "C:\Users\John\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
Make sure you check it out with a not too important file first!
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #4  
Old 04-15-2015, 02:20 PM
rain264 rain264 is offline How Do I Pull Slides from Multiple Files Windows 2K How Do I Pull Slides from Multiple Files Office 2013
Novice
How Do I Pull Slides from Multiple Files
 
Join Date: Apr 2015
Posts: 3
rain264 is on a distinguished road
Default

A quick tutorial on how to run this would be great! Thank you!
Reply With Quote
  #5  
Old 04-16-2015, 04:34 AM
JohnWilson JohnWilson is offline How Do I Pull Slides from Multiple Files Windows 7 64bit How Do I Pull Slides from Multiple Files Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
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
  #6  
Old 04-21-2015, 08:30 AM
rain264 rain264 is offline How Do I Pull Slides from Multiple Files Windows 2K How Do I Pull Slides from Multiple Files Office 2013
Novice
How Do I Pull Slides from Multiple Files
 
Join Date: Apr 2015
Posts: 3
rain264 is on a distinguished road
Default

Just wanted to say thanks! This works great and now takes about 3 seconds to build an entire file of 57 slides!

Is there a simple way to "keep source formatting" that can be added?
Reply With Quote
  #7  
Old 04-21-2015, 12:11 PM
JohnWilson JohnWilson is offline How Do I Pull Slides from Multiple Files Windows 7 64bit How Do I Pull Slides from Multiple Files Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Not really a simple way but you could try this (don't throw the old code away - I don't guarantee it will work!)

Code:
Sub PasteSlides()
Dim filenum As Integer
Dim strBuffer As String
Dim rayData() As String
Dim oLib As Presentation
Dim raySlides() As Long
Dim L As Long
Dim x As Long
filenum = FreeFile
' change to your text file location
Open "C:\Users\John\Desktop\data.txt" For Input As filenum
While Not EOF(filenum)
    Line Input #filenum, strBuffer
    rayData = Split(strBuffer, ",")
    Set oLib = Presentations.Open(FileName:=rayData(0), WithWindow:=False)
    ReDim raySlides(1 To rayData(2) - rayData(1) + 1)
    For L = CLng(rayData(1)) To CLng(rayData(2))
        x = x + 1
        raySlides(x) = L
    Next L
    oLib.Slides.Range(raySlides).Copy
    oLib.Close
    ActivePresentation.Windows(1).Activate
    CommandBars.ExecuteMso ("PasteSourceFormatting")
    DoEvents
    x = 0
Wend
End Sub
You will probably find you do NOT need quotes in the textfile
C:\Users\John\Desktop\Pres 1.pptx,1,1
C:\Users\John\Desktop\Pres 2.pptx,2,3

If there is always just ONE slide to paste from each file that will make it easier.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I Pull Slides from Multiple Files sumproduct formula to pull info from multiple sheets Berk21 Excel 7 01-15-2012 11:41 AM
Animation across multiple slides - please help jpscience PowerPoint 3 12-13-2011 11:32 AM
WYSIWYG exporting of slides to PNG files Pantucci PowerPoint 0 07-25-2011 07:47 AM
How Do I Pull Slides from Multiple Files convert multiple csv files to multiple excel files mit Excel 1 06-14-2011 10:15 AM
How Do I Pull Slides from Multiple Files macro to pull data from multiple files psrs0810 Excel 2 10-25-2010 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft