2
我使用下面的VBA宏刪除在PowerPoint幻燈片中的所有圖片:刪除照片使用VBA宏
Public Function delete_slide_object(slide_no)
' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
' Delete object in slide
Set PPSlide = PPPres.Slides(slide_no)
For Each PPShape In PPSlide.Shapes
If PPShape.Type = msoPicture Then
PPShape.Delete
End If
Next PPShape
Set PPShape = Nothing
Set PPSlide = Nothing
Set PPPres = Nothing
End Function
此代碼刪除一些但不是所有的pictures.After運行此代碼3次,所有圖片被刪除。我哪裏錯了?請讓我知道
他們有沒有機會嘗試答案呢? –
嘿,你好!剛剛嘗試了代碼。完美工作!非常感謝! :) – user2862496