VBA -adding slides

E

Edward

In 2003 we could use the following code to add a title slide

ActivePresentation.Slides.Add 1, ppLayoutTitle

but this code desn't work in 2007
PPs hel suggest a two line long example
Set pptLayout=Activepresentation.slides(1).design.slidemaster.customlayouts(1)

ActivePresentation.Slides.Add 1, pptLayout

my question is : Is there any simplier way to do this instead of useing two
lines all the time just for adding a new slide . In other words in Add
method for slides as the second argument ( " layout type" ) should alywas
refer to an object or we can just use a specific layout name like in 2003.
 
S

Shyam Pillai

Edward,
I don't see what the problem with ActivePresentation.Slides.Add 1,
ppLayoutTitle is since it works perfectly fine in PPT 2007. In PPT 2007
there is a new AddSlide method since this one exposes the new CustomLayouts
in the OM.

Regards,
Shyam Pillai

Animation Carbon: http://www.animationcarbon.com
 
E

Edward

Thanks. I guess my question was the problem I had using ADDslide . In 2003
and as you mentioned even in 2007 we can use add method and as its secon
srgument we just need to write ppLayoutTitle and it addes a title slide.
However in 2007 if I use addslide method

ActivePresentation.Slides.AddSlide 1,
ActivePresentation.Designs(1).SlideMaster.CustomLayouts(1)

for the second argument I can't simply write ppLayoutTitle and as you see I
had to use a long statement referring the a specific custsomlaayout . Is
there any way to have a shorter statment as the second argument like a
specific constant that refeeres to TitleLayout ? or the way I wrote is the
only possibile way of using addslside ?
Thanks
--
Best regards,
Edward


Shyam Pillai said:
Edward,
I don't see what the problem with ActivePresentation.Slides.Add 1,
ppLayoutTitle is since it works perfectly fine in PPT 2007. In PPT 2007
there is a new AddSlide method since this one exposes the new CustomLayouts
in the OM.

Regards,
Shyam Pillai

Animation Carbon: http://www.animationcarbon.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