macro to create new slide with background of previous slide

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i can easily create a new slide from within the macro, but i would like to
then insert the background from the previous slide into the new slide as
well. i understand so far that i have to turn of the property that tells it
to use the master background but i don't know how to make the background of
the new slide identical to the previous slide.
 
Wouldn't it be easier to simply duplicate the previous slide, delete all the
shapes from it and apply to desired layout?
 
Like this?

Sub BlankCopyOne()
Dim oSl As Slide
Dim oSh As Shape
ActivePresentation.Slides(1).Duplicate
Set oSl = ActivePresentation.Slides(2)
For Each oSh In oSl.Shapes
oSh.Delete
Next oSh
oSl.Layout = ppLayoutText
Set oSh = Nothing
Set oSl = Nothing
End Sub


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Like this?

Sub BlankCopyOne()
Dim oSl As Slide
Dim oSh As Shape
ActivePresentation.Slides(1).Duplicate
Set oSl = ActivePresentation.Slides(2)


For Each oSh In oSl.Shapes
oSh.Delete
Next oSh

Awwwww Bill ....

That'll delete every other shape, not every shape.
Howza bout:

Dim X as Long
For X = oSl.Shapes.Count to 1 Step -1
oSl.Shapes(X).Delete
Next
 
Doh!!

Of course you're right Steve.

:)


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Back
Top