需將百張照片依序放入各投影片 (一張圖一頁)?手動插入太慢,用 VBA 巨集一鍵搞定。
1.jpg、2.jpg...100.jpg,置於固定資料夾 (如 C:\Pictures\)。Sub InsertPic()
Dim i As Integer
For i = 1 To ActivePresentation.Slides.Count
ActivePresentation.Slides(i).Select
With ActiveWindow.Selection.SlideRange
.FollowMasterBackground = msoFalse
.Background.Fill.UserPicture "C:\Pictures\" & i & ".jpg"
End With
Next
End Sub
InsertPic → 「執行」。FollowMasterBackground = msoFalse:解除母版背景繼承,允許單頁設定背景。UserPicture:將指定圖檔設為投影片背景填滿。PERSONAL.XLSB)。此法適合相簿、產品目錄、時間軸等大量圖片鋪排場景,將小時人力壓縮至秒級。