Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2014, 06:43 PM
mrayncrental mrayncrental is offline PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT Windows 7 64bit PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT Office 2007
Novice
PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT
 
Join Date: Feb 2014
Posts: 15
mrayncrental is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 06-08-2014, 09:56 AM
JohnWilson JohnWilson is offline PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT Windows 7 64bit PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT 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

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
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 06-08-2014 at 12:45 PM.
Reply With Quote
  #3  
Old 06-09-2014, 02:52 AM
mrayncrental mrayncrental is offline PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT Windows 7 64bit PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT Office 2007
Novice
PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT
 
Join Date: Feb 2014
Posts: 15
mrayncrental is on a distinguished road
Default

This code is exactly what I needed. Thanks!
Reply With Quote
Reply



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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:24 AM.


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