需將百張照片每張佔一頁?逐張插入太慢。VBA 宏合併多步為一步:
圖片置於 C:\Pictures\,檔名有序:1.jpg、2.jpg…100.jpg
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 宏 → 秒完成Office + VBA = 強大自動化,批量操作不再怕。