VBA 2007-customlayout

E

Edward

Hi everybody,
In PP2007 I have added a cutomlayout to layout collection. I use the
following code to change the layout of a given slide
ActivePresentation.Slides(1).Layout = ppLayoutText
This code works fine with all built in layouts ,but I can't find a way to
apply the cutom layout . when I use the following code

ActivePresentation.Slides(1).Layout =ppLayoutCustom
I get the error
Slide (unknown number) : Invalid request. Invalid enumeration value.

Any suggestions that how can we apply a cutom layout in VBA?
 
C

Chirag

In PowerPoint 2007, a presentation has designs, each design has a
SlideMaster and that slide master has CustomLayouts collection with it. So,
you get access to an individual CustomLayout. Each slide refers to a
CustomLayout and you can assign it with a reference to the CustomLayout you
obtain from the Design.SlideMaster.CustomLayouts collection of the
presentation.

The ~40 Layouts that you are refering to from VBA are the pre-defined
layouts. You can indeed apply those and that would change the slide's
layout. But if you want to apply from the list of CustomLayouts, you need to
go the route discussed above.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
S

Sergey Kagan

Let's say you defined several customlayouts in your slidemaster. If your
want your slide has the third customlayout in your collection do this

ActivePresentation.Slides(1).CustomLayout
=ActivePresentation.SlideMaster.CustomLayouts(3)
Hope this helps
Sergey
 

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