Sub delPPTShapesActiveSlide() 'You can use early binding types, rather than object, on the below variables, by adding the Microsoft Powerpoint X.X Reference Library Dim oPPTApp As Object 'early binding use: PowerPoint.Application Dim oPPTFile As Object 'early binding use: PowerPoint.Presentation Dim oPPTSlide As Object 'early binding use: PowerPoint.Slide Dim oPPTShape As Object 'early binding use: PowerPoint.Shape Dim oPPTShapeArray() As Object 'early binding use: PowerPoint.Shape Dim i As Long On Error GoTo errHandler Set oPPTApp = GetObject(, "Powerpoint.Application") 'reference active powerpoint ' Reference active presentation Set oPPTFile = oPPTApp.ActivePresentation 'reference active presentation oPPTApp.ActiveWindow.ViewType = 1 'early binding use: ppViewSlide 'ensure in slide view mode, for modification Set oPPTSlide = oPPTApp.ActiveWindow.View.Slide 'gets the active slide 'enumerate shapes into array For Each oPPTShape In oPPTSlide.Shapes ReDim Preserve oPPTShapeArray(i) As Object 'early binding use PowerPoint.Shape Set oPPTShapeArray(i) = oPPTShape i = i + 1 Next oPPTShape 'then delete them, backwards to forwards, as there would be problems, deleting them serially For i = UBound(oPPTShapeArray) To LBound(oPPTShapeArray) Step -1 oPPTShapeArray(i).Delete Next i Set oPPTApp = Nothing Set oPPTFile = Nothing Set oPPTShape = Nothing Exit Sub
|Can I reduce the fonts available by excel or visio for one project, but enable the full set of fonts for all other purposes?||8||35|
|Create Excel formula on dynamic data||5||35|
|Filling Blank Cells||14||19|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
12 Experts available now in Live!