PDA

View Full Version : Autodeleting a textbox after it pops up



NIQ
06-29-2010, 09:12 AM
Hi all,

I had a problem with some code after the recent Office upgrade and found a workaround using the info here: pptalchemy.co.uk/PowerPoint_Screen_Refresh.html

However, despite what the guide says... the textbox created by this code does not autodelete and I am left with a bunch of little empty ghost textboxes in the upper left corner. Does anyone know how to delete them immediately? I am new to VBA and am having some trouble.

This is the code I am using

Private Sub CheckBox1_Click()
For Each Shape In ActivePresentation.SlideShowWindow.View.Slide.Shapes
If Shape.Name = CheckBox1.Caption Then
Shape.Visible = CheckBox1.Value
Shapes.AddTextbox msoTextOrientationHorizontal, 1, 1, 1, 1
End If
Next Shape
End Sub

NIQ
06-29-2010, 09:31 AM
Hmm nevermind I think I found the solution

Private Sub CheckBox1_Click()
For Each Shape In ActivePresentation.SlideShowWindow.View.Slide.Shapes
If Shape.Name = CheckBox1.Caption Then
Shape.Visible = CheckBox1.Value
Shapes.AddTextbox(msoTextOrientationHorizontal, 1, 1, 1, 1).Delete
End If
Next Shape
End Sub