![](/img/trans.png)
[英]Powerpoint VBA why does running a macro make the presentation start from the start again?
[英]run macro when start from presentation
打開演示文稿時,我想運行一個宏。 我嘗試使用以下方法:
Sub Auto_Open()
DoWhatIWant
End Sub
它有效...但是僅當您從Powerpoint圖標打開Powerpoint時。 但是,當我打開演示文稿時,只需雙擊要打開的演示文稿,我也要運行宏。
當您打開演示文稿時,PowerPoint僅在加載加載項時不會運行Auto_Open代碼。
您可以使用一個外接程序陷阱來捕獲當用戶打開一個新的演示文稿並運行您的代碼時觸發的事件(可能是在確定是否應基於與演示文稿有關的代碼來運行代碼之后)。
或PPTM演示文稿可能包含調用VBA例程的RibbonX。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.