Re: Defining Slide Layout in VBA using a variable



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

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 ... attribute on my Slide node called "layout". ...
    (microsoft.public.powerpoint)
  • Re: a question regarding
    ... I would very much like to see the ABI change happen, and the first step has been done already as part of the MAC work. ... By changing the size of a field in a data structure, you may change the layout of the structure, and hence the offset of other fields. ... On i386, the change from int to size_t doesn't modify the ABI, as both int and size_t are 32-bit. ... This is why DES and I have been discussing this change as requiring kernel compatibility code, which would provide new system calls working with the new layout, and retain old system calls working with the old layout. ...
    (freebsd-hackers)
  • Re: a question about private access
    ... > * dummy class with the same layout. ... solution will be highly specific to using BCB as the compiler. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: structure alignment
    ... > When i learned C i came across a section that showed the layout in memory ... > byte ordering for int is different on some platforms. ... you are using the right compiler options, ...
    (comp.os.linux.development.apps)
  • Re: folds and formatting
    ... commenting style. ... I find the second layout ugly, but when you fold based on brackets, ... editors allow me not to fold, ...
    (comp.lang.c)