我会如何实现这一目标?因为我经常添加和删除幻灯片,所以我需要使用代码来了解我来自哪个幻灯片,而不仅仅是设置幻灯片。VBA PowerPoint - 回到幻灯片我来自
1
A
回答
4
SlideShowWindows(1).View.GotoSlide(SlideShowWindows(1).View.LastSlideViewed.SlideIndex)
+0
这比我使用的LOL简单得多! – dennis96411
0
我想通了。从浏览网页和一点思维的一些帮助,我本想出了:
对于存储,除了需要你回去到另一张幻灯片的幻灯片当前幻灯片编号,我做了一个模块:
Public CurrentSlide As Long, PreviousSlide As Long
Public Sub GoToPreviousSlide()
SlideShowWindows(1).View.GoToSlide (PreviousSlide)
End Sub
Public Sub StoreCurrentSlide()
CurrentSlide = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
If CurrentSlide <> 14 Then
'Execute only if the current slide is not a slide that uses this function (because if you store the current slide while in a slide that requires you to go back to another slide, it will overwrite the PurrentSlide value and render this useless). Add more slide numbers to the If statement as you need them.
PreviousSlide = CurrentSlide
Call GoToPreviousSlide
End If
End Sub
当然我必须确保我打电话StoreCurrentSlide每一个幻灯片的变化,我做了另一个模块自动执行此时间:
Public Sub OnSlideShowPageChange()
StoreCurrentSlide
End Sub
现在,我可以在任何地方使用一个按钮并返回到以前的幻灯片使用:
Private Sub OK_Click()
GoToPreviousSlide
End Sub
0
如果您使用的是按钮无论如何,为什么不使用PPT的操作设置;分配先前观看的幻灯片的动作设置。单击该按钮将使观众回到当前幻灯片之前他们正在查看的任何幻灯片。
不需要VBA。
+1
我对操作设置有不好的经验,但那是在Office 2003中。它会在幻灯片之前,而不是我从幻灯片来的幻灯片。比如说,如果我从第2张幻灯片跳到第5张幻灯片,并且想要返回,则动作设置会将我带到4。 – dennis96411
相关问题
- 1. VBA PowerPoint幻灯片标题
- 2. VBA PowerPoint写入幻灯片的幻灯片更改
- 3. PowerPoint VBA代码将焦点带回运行PowerPoint幻灯片
- 4. Powerpoint vba更新幻灯片主文件
- 5. powerpoint vba随机幻灯片启动
- 6. Excel VBA在PowerPoint中复制幻灯片
- 7. 使用VBA粘贴范围从Excel到PowerPoint幻灯片的某个幻灯片
- 8. VBA来删除活动的幻灯片在PowerPoint
- 9. IOS PowerPoint幻灯片导航
- 10. 幻灯片在Powerpoint中
- 11. 定制Powerpoint幻灯片
- 12. 控制PowerPoint幻灯片
- 13. 使用VBA在PowerPoint中自动幻灯片编号
- 14. 使用CommandButton VBA将PowerPoint幻灯片添加到文本框
- 15. PowerPoint VBA - 将形状复制到幻灯片
- 16. VBA Powerpoint幻灯片数据到组合框项目
- 17. 使用COM和PHP合并/创建PowerPoint幻灯片幻灯片
- 18. 幻灯片放映幻灯片中的PowerPoint插件写入
- 19. PowerPoint幻灯片只显示幻灯片的一部分
- 20. C#复制PowerPoint幻灯片版式
- 21. 幻灯片中的幻灯片?
- 22. 比较Powerpoint幻灯片中的图片
- 23. 使用vba在excel中为每张幻灯片创建一个幻灯片
- 24. Powerpoint:将单个幻灯片复制到新的PowerPoint文件中
- 25. 将Web上的图片添加到VBA中的Powerpoint幻灯片(MacOS)
- 26. 使用VBA创建Powerpoint幻灯片母版
- 27. 如何使用VBA动态引用PowerPoint幻灯片
- 28. VBA中的Powerpoint幻灯片计数变量
- 29. 的PowerPoint VBA创建和保存幻灯片
- 30. 加载项文件幻灯片的内容 - VBA Powerpoint 2010
你是什么意思'回到我来自幻灯片'。您是通过代码进行移动还是您的意思是每次手动删除或插入您想要返回到之前选定幻灯片的幻灯片?如果您删除多幻灯片删除中的上一张幻灯片,该怎么办? – brettdj
我想通了,但我感觉与该代码来限制。 – dennis96411