#1
|
|||
|
|||
PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT
I use PowerPoint to display a series of photos ---1 picture per slide (I use insert - photo album.)
Many times I need to "redo" the series of pictures. So I want to create a macro that will copy the pictures from one PPT and delete/paste the pictures in another powerpoint. Something like this: Have Presentation 1, Open Presentation 2 (slides to copy from) Presentation 2 - Slide 1 - copy picture Presentation 2 - Slide 1 - delete picture, paste picture Presentation 2 - Slide 2 - copy picture Presentation 2 - Slide 2 - delete picture, paste picture Etc. I have to do this manually for about 50 slides, so a macro would be GREAT! Thanks for your help! Mod comment: When you cross post to other forums please mention this. Cross post http://windowssecrets.com/forums/sho...des-to-another Last edited by JohnWilson; 06-08-2014 at 10:01 AM. |
#2
|
|||
|
|||
If you used Photo Album EDIT Just read your other post - If there is OTHER content this will not work!
Just go back to INSERT Photo Album. Choose EDIT and seelct the first and shift select the last image > DELETE. Then add the new images. Should take less than a minute. Difficult to write a macro without seeing the files. If the two presentations have the same number of slides and images this MIGHT work. Use a copy in case it gores wrong and change the names of the files in the code to match the names you have. Sub switchPic() Dim oTarget As Presentation Dim oSource As Presentation Dim i As Integer Dim oshp As Shape 'NOTE use the names of your own presentations Set oTarget = Presentations("Image1.pptx") Set oSource = Presentations("Image2.pptx") For i = 1 To oSource.Slides.Count If oSource.Slides(i).Shapes(1).Type = msoPicture Then oSource.Slides(i).Shapes(1).Copy End If If oTarget.Slides(i).Shapes(1).Type = msoPicture Then oTarget.Slides(i).Shapes(1).Delete oTarget.Windows(1).Activate ActiveWindow.View.GotoSlide i oTarget.Slides(i).Shapes.Paste End If Next i End Sub Last edited by JohnWilson; 06-08-2014 at 12:45 PM. |
#3
|
|||
|
|||
This code is exactly what I needed. Thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I use a Macro to automatically update all the pictures in a word doc | GezLundy | Word VBA | 3 | 06-12-2014 03:23 AM |
VBA for pictures positioning in powerpoint | iebogu | PowerPoint | 1 | 01-17-2014 05:47 AM |
Copy picture style to all pictures in a presentation | Gary Drumm | PowerPoint | 2 | 04-18-2013 10:36 AM |
Colour mismatch inserting pictures into Powerpoint 2010 | Osprey | PowerPoint | 0 | 10-25-2012 08:44 AM |
Search Replace Copy | dblack7211 | Word | 0 | 05-05-2010 01:19 PM |