Я относительно новичок в VB, я пытаюсь сделать l oop через фигуры на каждом слайде, которые активируются кнопкой ActiveX на первом слайде, но при попытке инициировать для l * 1006. * для Slide2 он возвращает ошибку «Требуется объект».
Я использую Microsoft PowerPoint 2018 и встроенный редактор Visual Basi c.
Private Sub DisableNavArrows_Click()
If Slide1.DisableNavArrows.Caption = "Disable arrow buttons (RECOMMENDED)" Then
Slide1.DisableNavArrows.Caption = "Enable arrow buttons (NOT RECOMMENDED)"
For Each oshp In Slide1.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = False
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = False
End If
Next oshp
For Each oshp In Slide2.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = False
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = False
End If
Next oshp
For Each oshp In Slide3.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = False
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = False
End If
Next oshp
For Each oshp In Slide4.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = False
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = False
End If
Next oshp
For Each oshp In Slide5.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = False
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = False
End If
Next oshp
For Each oshp In Slide6.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = False
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = False
End If
Next oshp
Else
Slide1.DisableNavArrows.Caption = "Disable arrow buttons (RECOMMENDED)"
For Each oshp In Slide1.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = True
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = True
End If
Next oshp
For Each oshp In Slide2.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = True
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = True
End If
Next oshp
For Each oshp In Slide3.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = True
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = True
End If
Next oshp
For Each oshp In Slide4.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = True
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = True
End If
Next oshp
For Each oshp In Slide5.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = True
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = True
End If
Next oshp
For Each oshp In Slide6.Shapes
If oshp.Name = "ArrowRight" Then
oshp.Visible = True
ElseIf oshp.Name = "ArrowLeft" Then
oshp.Visible = True
End If
Next oshp
End If
End Sub