Discussion:
VBA 2007-customlayout
(too old to reply)
Edward
2009-06-11 17:15:02 UTC
Permalink
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?
--
Best regards,
Edward
Chirag
2009-06-11 18:50:20 UTC
Permalink
Look at http://skp.mvps.org/2007/ppt003.htm for understanding Custom
Layouts.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
Post by 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?
--
Best regards,
Edward
Edward
2009-06-11 23:29:01 UTC
Permalink
I have read Shyam's website articles. In his code he adds a background
picture to slide one of the master slide which works fine. I want to apply a
customlayout to a slide and I have problem finding a way of doing it in VBA.
In VBA there are about 40 different layouts that we can apply , but only 11
layouts are avalible in UI , so I think this new customlayout object in
PP2007 is still immature and and fully copleted yet .
--
Best regards,
Edward
Post by Chirag
Look at http://skp.mvps.org/2007/ppt003.htm for understanding Custom
Layouts.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
Post by 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?
--
Best regards,
Edward
Chirag
2009-06-12 00:37:40 UTC
Permalink
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
Post by Edward
I have read Shyam's website articles. In his code he adds a background
picture to slide one of the master slide which works fine. I want to apply a
customlayout to a slide and I have problem finding a way of doing it in VBA.
In VBA there are about 40 different layouts that we can apply , but only 11
layouts are avalible in UI , so I think this new customlayout object in
PP2007 is still immature and and fully copleted yet .
--
Best regards,
Edward
Post by Chirag
Look at http://skp.mvps.org/2007/ppt003.htm for understanding Custom
Layouts.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
Post by 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?
--
Best regards,
Edward
Sergey Kagan
2009-06-13 00:48:53 UTC
Permalink
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
Post by 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
Post by Edward
I have read Shyam's website articles. In his code he adds a background
picture to slide one of the master slide which works fine. I want to apply a
customlayout to a slide and I have problem finding a way of doing it in VBA.
In VBA there are about 40 different layouts that we can apply , but only 11
layouts are avalible in UI , so I think this new customlayout object in
PP2007 is still immature and and fully copleted yet .
--
Best regards,
Edward
Post by Chirag
Look at http://skp.mvps.org/2007/ppt003.htm for understanding Custom
Layouts.
- Chirag
PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
Post by 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?
--
Best regards,
Edward
Loading...