我會如何實現這一目標?因爲我經常添加和刪除幻燈片,所以我需要使用代碼來了解我來自哪個幻燈片,而不僅僅是設置幻燈片。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