Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
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
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!