Thread: [Solved] Copy slide then insert Text
View Single Post
 
Old 06-07-2016, 09:47 AM
Nick70 Nick70 is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Jun 2016
Location: London
Posts: 13
Nick70 is on a distinguished road
Default Copy slide then insert Text

Hi,

I have some code that looks for a specific slide (ie.slide 2) in a Presentation (eg. PresentationA.pptx) then copies it into the active Presentation (eg. PresentationB.pptx) in a specific order (ie. in slide 12).

Code:
Sub Copy()
Dim objPres As Presentation
Dim i As Integer
Dim target As Presentation
Set target = ActivePresentation
src = Array(2)                                       ' source position
tgt = Array(12)                                      ' target position
Set objPres = Presentations.Open("C:\Users\PresentationA.pptx") 'target file
For i = LBound(src) To UBound(src)
    objPres.Slides(src(i)).Copy
    target.Slides.Paste tgt(i)
    target.Slides(tgt(i)).Design = target.Slides(src(i)).Design
Next i
objPres.Close
End Sub
I would now like to insert some text in slide which has been copied so that when I look at PresentationB.pptx I can recognize it easily.

I was thinking of inserting a text saying "NEW" in bold red.

How can I amend my code so that once the slide is copied into PresentationB.pptx it will also have such text saying "NEW"?

Thanks,
Nic
Reply With Quote