PDA

View Full Version : Copy content from slide in file 1 and paste on file 2



magnel
02-22-2018, 12:25 PM
Hello,

I am using PPT 2010 and I am searching for a code which can copy only the content of a particular slides in a different presentation (an autoshape or group of shapes). Currently I am able to insert the whole slide into an active presentation with the below code, but I am not getting correct set of codes to copy just the content of that slide.

Sub slidecontent()
Dim objPresentation As Presentation
Dim i As Integer
Set objPresentation = Presentations.Open("C:\Desktop\repository 1.pptx")
For i = 1 To objPresentation.Slides.Count
objPresentation.Slides.Item(i).Copy
Presentations.Item(1).Slides.Paste
Presentations.Item(1).Slides.Item(Presentations.Item(1).Slides.Count).Desig n = objPresentation.Slides.Item(i).Design
Next i
objPresentation.Close
End Sub


Please can someone me with the correct set of codes.

magnel
02-25-2018, 03:11 AM
I have a set of slides which has multiple grouped autoshapes on each slide called the "repository.pptx".
I am searching for a code which copies a specific grouped object from any of these slides and paste to the active presentation.

I got the piece that copies the object to the active presentation.

Sub copyobject()
Dim objPresentation As Presentation
Set objPresentation = Presentations.Open("\Desktop\repository.pptx")
Dim PPShape As Object
objPresentation.Slides.Item(1).Shapes("Group 8").Copy
Set PPShape = Presentations.Item(1).Slides(1).Shapes.Paste
objPresentation.Close
End Sub


But it paste the object to the very first slide in the active presentation and not in the active slide. Also it copies only grouped object from the very first slide from repository.pptx

Please can someone help with the missing piece of code.

Thanks

magnel
03-02-2018, 11:25 AM
Hi John,

Can you help with the missing piece of code to paste the object on the current slide.

Thanks,