macro to create new slide with background of previous slide

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.
 
S

Shyam Pillai

Wouldn't it be easier to simply duplicate the previous slide, delete all the
shapes from it and apply to desired layout?
 
B

Bill Dilworth

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
..
 
S

Steve Rindsberg

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
 
B

Bill Dilworth

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top