Hi there,
THE REQUIREMENT in PPT 2010:
I have a presentation with 2 slides. Each slide has 4 autoshapes. Each autoshape has a textbox in it and each textbox content is unique from the other.
I am trying to run a macro when an action button is clicked on that slide. The macro should check for 2 textboxes which have certain strings in them and then delete those two textboxes from the autoshape so that the two autoshapes become blank.
THE ERROR
The error I am encountering is that the macro is deleting all the textboxes in the autoshapes on a slide.
However, interestingly enough, when I end my slideshow, I notice that that the textboxes I want deleted are indeed deleted and the other two textboxes are visible (BUT once the slideshow is closed and I go back to edit mode).
Here is the sample code:
Dim ss1 as Powerpoint.slide
For Each ss1 In ActivePresentation.Slides
For Each shp1 In ss1.Shapes
If shp1.Type = msoTextBox Then
If StrComp(shp1.TextFrame.TextRange, "D:", vbTextCompare) = 0 Then shp1.Delete
End If
Next shp1
Next ss1
For Each ss2 In ActivePresentation.Slides
For Each shp2 In ss2.Shapes
If shp2.Type = msoTextBox Then
If StrComp(shp2.TextFrame.TextRange, "B:", vbTextCompare) = 0 Then shp2.Delete
End If
Next shp2
Next ss2
Any help would be appreciated!!!
Thanks