View Single Post
 
Old 12-14-2013, 10:10 PM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

PowerPoint allows you to have shapes with the same name on a single slide. This is really bad coding! When you delete though it only deletes the first shape with that name!

To get them all try:

Sub deletePix()
Dim osld As Slide
Dim lngCount As Long
'insert the real name instead of Picture 2
Const PicName As String = "Picture 2"
On Error Resume Next
For Each osld In ActivePresentation.Slides
For lngCount = osld.Shapes.Count To 1 Step -1
If osld.Shapes(lngCount).Name = PicName Then osld.Shapes(lngCount).Delete
osld.Shapes(PicName).Delete
Next lngCount
Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote