1.開啟ppt檔案,按下alt+F11 開啟VBA,然後按下Ctrl+G (windows) 或 ^⌘G (Mac) 顯示立即視窗(如下圖)

2.在立即視窗內輸入
ActivePresentation.SaveAs "C:/test.htm", ppSaveAsHTML, msoFalse
(mac檔名處若不加上路徑直接輸入 "test.htm" 則檔案會存到「文件」資料夾內)。
然後按下Enter,即可在指定路徑下存成test.htm檔案
var randomNum = Math.floor(Math.random() * customVal); //customVal 可以是自訂的參數,譬如以視窗或指定div的高或寬