24.5. WOrking With Slides

Once you have created or opened the presentation you want to affect, you can access the slides it contains by using the Slides collection, which contains a Slide object for each slide in the presentation. Each slide is identified by its index number, but you can also use object variables to refer to slides or assign names to slides. These techniques are especially useful when you add slides to or delete slides from the presentation, causing the index numbers of the slides to change.

24.5.1. Adding a Slide to a Presentation

To add a slide to a presentation, use the Add method with the Slides collection. The syntax is as follows:

expression.Add(Index, Layout)

Here are the components of this syntax:

  • expression is a required ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.