Re: Defining Slide Layout in VBA using a variable

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

<koldkompress@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


.



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: 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: Dynamically Update Text Box on-slide with loop (VBA)
    ... the slide. ... checked and strDiff does not get updated during the loop. ... Dim EventDate As Date, curDate As Date ... Dim sDateFile As String ...
    (microsoft.public.powerpoint)
  • Re: Auto_NextSlide Help Needed
    ... Sub Auto_NextSlide ... textbox that will stay on the slide without at lease one char in it. ... Dim EventDate As Date, curDate As Date ... Dim sDateFile As String ...
    (microsoft.public.powerpoint)
  • Re: retrieving transition information
    ... the slide name or number the title of each slide and the various other bits ... Dim oPres as Presentation ... sBodyText As String) ... Dim FileNum As Integer ...
    (microsoft.public.powerpoint)