Article ID: 158913
Article Last Modified on 10/11/2006
Sub VisitEverySlide()
' This Macro vists every slide within every active presentation.
Dim NumberOfPresentations As Integer
Dim NumberOfSlides As Integer
' Declare the variables for loops.
Dim x, y As Long
' Retrieves the total number of open presentations.
NumberOfPresentations = Application.Presentations.Count
' Loops through every open presentation.
For i = 1 To NumberOfPresentations
' Set pres = Application.Presentations(i)
' Counts the number of slides within the current presentation.
NumberOfSlides = Application.Presentations(i).Slides.Count
' Goes through every slide in the presentation.
For j = 1 To NumberOfSlides
' This sample adds a rectangle to every slide.
' Remove this code and add your slide-specific code here.
With Application.Presentations(i).Slides.Item(j).Shapes
.AddShape msoShapeRectangle, 50, 50, 100, 200
End With
Next j
Next i
End Sub
176476 OFF: Office Assistant Not Answering Visual Basic Questions
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: 97 8.00 ppt8 power point pptnt cycle through repetitive vba ole automation
Keywords: kbcode kbdtacode kbhowto kbmacro kbprogramming KB158913