Operon
01-04-2011, 12:36 PM
I have a master slide (Slide2) with fifty shapes - Freeform1, Freeform2,.. etc. From subsequent slides I want to run a macro to hide a particular shape on the master slide and then return to the master slide. [Each slide from which the macro runs is arithmetically related to the shape I wish to hide.]
The code below is not doing it for me.
Sub Map()
Dim slide_no As Integer
Dim shape As shape
Dim shape_no As Long
Dim shapename As String
slide_no = ActiveWindow.View.Slide.SlideIndex
shape_no = slide_no + 1
With ActivePresentation.Slides(2)
shapename = "Freeform" & shape_no
For Each shape In ActivePresentation.Slides(2).Shapes
If shape.Name = shapename Then
ActivePresentation.Slides(2).Shapes("shapename").Visible = False
End If
Next
End With
On Error Resume Next
SlideShowWindows(1).View.GotoSlide 2
If Error <> 0 Then
ActivePresentation.SlideShowSettings.Run
SlideShowWindows(1).View.GotoSlide 2
End If
End Sub
Many thanks for any and all helpful suggestions.
Cheers,
John
The code below is not doing it for me.
Sub Map()
Dim slide_no As Integer
Dim shape As shape
Dim shape_no As Long
Dim shapename As String
slide_no = ActiveWindow.View.Slide.SlideIndex
shape_no = slide_no + 1
With ActivePresentation.Slides(2)
shapename = "Freeform" & shape_no
For Each shape In ActivePresentation.Slides(2).Shapes
If shape.Name = shapename Then
ActivePresentation.Slides(2).Shapes("shapename").Visible = False
End If
Next
End With
On Error Resume Next
SlideShowWindows(1).View.GotoSlide 2
If Error <> 0 Then
ActivePresentation.SlideShowSettings.Run
SlideShowWindows(1).View.GotoSlide 2
End If
End Sub
Many thanks for any and all helpful suggestions.
Cheers,
John