Eric Shen
asked on
Resizing every other graphic
Hi,
I am working on a 3000 power point slide where there is one image per slide. I would like to re-position all the odds slides one way, and all the even slides another. This is what i have so far:
Sub repodd()
Dim I As Long
Dim opic As Shape
Dim osld As Slide
With ActivePresentation.Slides
For I = 1 To .Count
If I Mod 2 = 1 Then
For Each opic In osld.Shapes
If opic.Type = msoPicture Then
With opic
.LockAspectRatio = msoFalse
.Top = 1.99 * 72
.Left = 0.2 * 72
End With
End If
Next I
Next opic
Next osld
End With
End Sub
This unfortunately is not working. Was wondering if I could get a fresh pair of eyes. I'm a very big novice to VBA but very interested to learn more.
Follow Up: I believe if I wanted to do even slides, I would just change this line: If I Mod 2 = 1 to If I Mod 2 = 0. Correct?
I am working on a 3000 power point slide where there is one image per slide. I would like to re-position all the odds slides one way, and all the even slides another. This is what i have so far:
Sub repodd()
Dim I As Long
Dim opic As Shape
Dim osld As Slide
With ActivePresentation.Slides
For I = 1 To .Count
If I Mod 2 = 1 Then
For Each opic In osld.Shapes
If opic.Type = msoPicture Then
With opic
.LockAspectRatio = msoFalse
.Top = 1.99 * 72
.Left = 0.2 * 72
End With
End If
Next I
Next opic
Next osld
End With
End Sub
This unfortunately is not working. Was wondering if I could get a fresh pair of eyes. I'm a very big novice to VBA but very interested to learn more.
Follow Up: I believe if I wanted to do even slides, I would just change this line: If I Mod 2 = 1 to If I Mod 2 = 0. Correct?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much! Worked like a charm
Sub repodd()
Dim opic As Shape
Dim osld As Slide
For Each osld In ActivePresentation.Slides
If osld.SlideIndex / 2 = osld.SlideIndex \ 2 Then 'even
For Each opic In osld.Shapes
If opic.Type = msoPicture Then
With opic
.LockAspectRatio = msoFalse
.Top = 1.99 * 72
.Left = 0.2 * 72
End With
End If
Next opic
Else
'odd
End If
Next osld
End Sub