Thread: [Solved] Copy slide then insert Text
View Single Post
 
Old 06-07-2016, 10:05 AM
JohnWilson JohnWilson is offline Windows 7 64bit 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

It's not clear why you specified an Array but maybe there is code you are not showing.

If it's just slide 2 being inserted at 12 try this (not tested)

Code:
Sub Copy()
Dim newslide As SlideRange
Dim pasteFrom As Long
Dim pasteTo As Long
Dim objPres As Presentation
Dim i As Integer
Dim target As Presentation
Set target = ActivePresentation
pasteFrom = 2                                 ' source position
pasteTo = 12                              ' target position
'Note I changed the Path
Set objPres = Presentations.Open("C:\PresentationA.pptx") 'target file

    objPres.Slides(pasteFrom).Copy
   Set newslide = target.Slides.Paste(pasteTo)
   With newslide(1).Shapes.AddShape(msoShapeRectangle, 10, 10, 100, 20)
   .Fill.Visible = False
   .TextFrame.TextRange = "NEW"
   .TextFrame.TextRange.Font.Color.RGB = vbRed
   End With
    target.Slides(pasteTo).Design = target.Slides(pasteFrom).Design

objPres.Close
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote