Incrementing slides with queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currently have created a vba routine that steps through queries and slides
on a powerpoint presentation. The powerpoint presentation is laid out as a
template to ensure that the titles and graphs are formatted correctly. I have
been using the slide number to match the query, eg. slide 1 runs
query1output. This is complicated by the fact that a case statement is used
to determine if the slide needs further manipulation. I am having a problem
designing a routine that will match the proper slide with a query when a
table is created that inserts additional slides.

The template ppt has one slide as a placeholder and formatted titles for a
table. The table is comprised of data that changes length depending on the
month for the query. Because of this dynamic nature the original slide may
turn into 2 or more. When the slide rolls past 1 my query name, slide number
and case statement no longer match. The original slide number 3 has become
slide number 5 and needs to have the query of query3output inserted. This
also throws all slides and cases following the table off by a number.

Any pointers or suggestions would be appreciated.

Bill
 
I currently have created a vba routine that steps through queries and slides
on a powerpoint presentation. The powerpoint presentation is laid out as a
template to ensure that the titles and graphs are formatted correctly. I have
been using the slide number to match the query, eg. slide 1 runs
query1output. This is complicated by the fact that a case statement is used
to determine if the slide needs further manipulation. I am having a problem
designing a routine that will match the proper slide with a query when a
table is created that inserts additional slides.

The template ppt has one slide as a placeholder and formatted titles for a
table. The table is comprised of data that changes length depending on the
month for the query. Because of this dynamic nature the original slide may
turn into 2 or more. When the slide rolls past 1 my query name, slide number
and case statement no longer match. The original slide number 3 has become
slide number 5 and needs to have the query of query3output inserted. This
also throws all slides and cases following the table off by a number.

I'd probably either tag or name the slides rather than relying on slide numbers.

To name/tag all the slides:

Dim X as Long
With ActivePresentation
For X = 1 to .Slides.Count
' to name the slide
.Slides(X).Name = Cstr(X)
' to tag the slide
.Slides(X).Tags.Add "Query", Cstr(X)
Next
End With

To return the tag, assuming a reference to the slide in oSl:

Debug.Print oSl.Tags("Query")
 
Back
Top