View Full Version : Linking/importing slides from minor to major presenation
kasbac
10-08-2012, 04:10 AM
Hi there
On a weekly basis i need to manually update a slide pack based on inputs from multiple people. Currently people will provide their updates in slides which i then copy/paste manually into my master presentation.
Is there anyway a macro could be written that could make this import?
I am thinking something along the line of:
1. Delete slide 3,4 and 5 in master presenation
2. Identify and open minor presentation
3. Copy slide 3,4,5 from minor presentation
4. Paste in the three slides in the master presentation
Any help is highly appreciated! If any questions or clarification is needed please let me know.
shilpa173
10-10-2012, 03:26 AM
HI
i always used powerpoint to present our project its better option.
i am promoting one of website that page is created in fb desh me aaj.
kasbac
10-16-2012, 01:36 PM
bump
John Wilson
10-17-2012, 02:09 AM
Assuming the major presentation is open and active and the minor is saved on the PC try this.
Obviously change strpath to point at the minor presentation.
Sub Importer()
Dim strPath As String
strPath = "C:\Users\John\Desktop\test.pptx"
ActivePresentation.Slides.Range(Array(3, 4, 5)).Delete
ActivePresentation.Slides.InsertFromFile _
FileName:=strPath, _
Index:=2, _
SlideStart:=3, _
SlideEnd:=5
End Sub
kasbac
10-22-2012, 02:27 AM
Hi John
Sorry for the late reply, really appreciate your inputs on this.
I was wondering if you or anyone else could help me with two things.
Firstly the file name of the minor will change from week to week for example to test 20121022.ppt or "test inputs from JD.ppt" Therefore I need the macro to do some sort of fuzzy search for the text string "test" in the below to identify the test file.
Secondly instead of looking in a hard coded path I would like for the macro to look for the minor files in the same directory as the master file is saved. Something along the line of myDir, would this be possible?
If any clarification is needed please let me know.
John Wilson
10-22-2012, 03:43 AM
This might work (not tested)
Sub FuzzyImporter()
Dim strPath As String
Dim StrFile As String
Dim b_found As Boolean
Dim findPath As String
Dim oTemp As Presentation
strPath = ActivePresentation.Path & "\"
StrFile = Dir$(strPath & "*.pp*") ' all PowerPoint
While StrFile <> "" And b_found = False
Set oTemp = Presentations.Open(strPath & StrFile, msoFalse, msoFalse, msoFalse)
If oTemp.Name Like "*test*" Then
b_found = True
findPath = strPath & StrFile
End If
oTemp.Close
Set oTemp = Nothing
If b_found = False Then StrFile = Dir()
Wend
If Len(findPath) > 0 Then
ActivePresentation.Slides.Range(Array(3, 4, 5)).Delete
ActivePresentation.Slides.InsertFromFile _
FileName:=findPath, _
Index:=2, _
SlideStart:=3, _
SlideEnd:=5
Else
MsgBox "File not found", vbCritical
End If
End Sub
An alternative would be to create a filedialog to navigate to the file,
kasbac
10-22-2012, 04:19 AM
great thanks John that worked like a charm!
One question for you since you seem to be quite an expert. Instead of deleting and importing my updates as im doing with the above macro is there anyway in which i can make links between my presenations so that any updates in the test workbook is reflected in my master workbook automatically?
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.