由VBA代码设置的自定义展示操作,但显示“自定义展示”不存在”

时间:2019-02-01 11:44:47

标签: vba ms-office powerpoint

我正在使用代码执行以下操作;
1.获取当前幻灯片索引
2.转到特定的幻灯片显示
3.更改形状的动作以进行特定的幻灯片显示(指的是上一个,但我不想使用ppPreviousSlide动作)

一切正常,但是当我单击更改动作交互的形状时,它显示“自定义节目不存在”

Error

Sub gotoTomatoVariety()
Dim tomatoSlide As Integer: tomatoSlide = 63
Set tableSlide = ActivePresentation.Slides(SlideShowWindows(1).View.Slide.SlideIndex)
SlideShowWindows(1).View.GotoSlide (tomatoSlide)

With ActivePresentation.Slides(tomatoSlide).Shapes("Go Back") _
    .ActionSettings(ppMouseClick)
    .Action = ppActionNamedSlideShow
    .SlideShowName = "Slide59"
End With
End Sub

1 个答案:

答案 0 :(得分:0)

替换此:

.ActionSettings(ppMouseClick)
.Action = ppActionNamedSlideShow

与此:

With.ActionSettings(ppMouseClick)
  .Action = ppActionNamedSlideShow
  .SlideShowName = "name of your custom show"
End With ' action settings