Re: Defining Slide Layout in VBA using a variable

Tech-Archive recommends: Fix windows errors by optimizing your registry




"KoldKay" <koldkompress@xxxxxxxxx> wrote in message news:1181048842.017200.50270@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 5, 1:28 pm, KoldKay <koldkompr...@xxxxxxxxx> wrote:
On Jun 5, 1:02 pm, "Chirag" <Chi...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> getAttribute() returns a string but the second argument to Slides.Add() > is
> an enum or an int. You need to convert the ppLayout* constants that you > get
> as string to their int values and pass it as second argument.

> - Chirag

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

> <koldkompr...@xxxxxxxxx> wrote in message

>news:1181038868.148517.233570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

> > Hi all,

> > I'm using VBA to parse an XML file into a powerpoint. I've got an
> > attribute on my Slide node called "layout". When I come to create a
> > slide I use this code:

> > ' For each subject within the presentation
> > For Each SubjNode In PresNode.childNodes

> > ' For each slide within that subject..
> > For Each SlideNode In SubjNode.childNodes

> > 'Create that slide
> > Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1,
> > SlideNode.getAttribute("layout"))

> > If you note the last line of code, it has the slides.add with the
> > layout attribute from the SlideNode. However, I get a "Type > > Mismatch"
> > even though a Debug.Print SlideNode.getAttribute("layout") displays
> > the correct layout (ppLayoutText)

> > Thanks

> > Michael- Hide quoted text -

> - Show quoted text -

Hey Chirag,

Thanks, that's really done the trick. All I have to do now is figure
out all the numerical IDs and then use my database to convert them.

Thanks again

Michael- Hide quoted text -

- Show quoted text -

I know I'm replying to myself, but if anyone needs references for
these, here's my rough guide:

1 = Title with subtitle
2 = title + text
3 = Title + Two Text
4 = Title + Table
5 = Title + text + chart
6 = Title + Chart + Text
7 = Title + Diagram
8 = Title + Chart
9 = Title + text + Clipart
10 = Title + Clipart + Text
11 = Title [At top] only
12 = Blank
13 = Title + text + content
14 = Title + Content + text
15 = Large Content
16 = Title + Content
17 = Title + Text + Media Clip
18 = Title + Media Clip + Text
19 = Title + Content + text
20 = Title + Text + Content
21 = Title + Text + Content + Content
22 = Title + Content + Content + text
23 = Title + Content + Content + Text [Vertical]
24 = Title + Content + Content + Content + Content
25 = Title + Side Text
26 = Title + Clipart + Side Text
27 = Side Title + Side Text
28 = Side Title + Sidetext + Chart
29 = Title + Content + Content
30 = Title + Content + Small content + Small Content
31 = Title + Small Content + small Content + Content

These are documented at (look for PpSlideLayout):
http://msdn2.microsoft.com/en-us/library/aa211582(office.11).aspx

Microsoft Office PowerPoint 2007 introduces a few more:
ppLayoutCustom = 32
ppLayoutSectionHeader 33
ppLayoutComparison = 34
ppLayoutContentWithCaption = 35
ppLayoutPictureWithCaption = 36

- Chirag

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


Thanks

Michael

.



Relevant Pages

  • Re: Defining Slide Layout in VBA using a variable
    ... You need to convert the ppLayout* constants that you get as string to their int values and pass it as second argument. ... PowerShow - View multiple PowerPoint slide shows simultaneously ...
    (microsoft.public.powerpoint)
  • Re: Defining Slide Layout in VBA using a variable
    ... You need to convert the ppLayout* constants that you get ... as string to their int values and pass it as second argument. ... attribute on my Slide node called "layout". ... For Each SlideNode In SubjNode.childNodes ...
    (microsoft.public.powerpoint)
  • Re: Defining Slide Layout in VBA using a variable
    ... You need to convert the ppLayout* constants that you get ... as string to their int values and pass it as second argument. ... PowerShow - View multiple PowerPoint slide shows simultaneously ... attribute on my Slide node called "layout". ...
    (microsoft.public.powerpoint)