Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PowerPoint Textbox control 3

Status
Not open for further replies.

misscrf

Technical User
Jun 7, 2004
1,344
US
I have various textbox controls on a powerpoint. At the end of the presentation, I want their value to be nothing, so that when I open it the next time, it is clean. I created a "The End" command button, but none of the code I have tried works.

I tried

textbox1.value = ""
textbox1.text = ""

I compiles ok, but then gives me a debug error.

:-(

Does anyone know the trick to this?

Thanks,

misscrf

It is never too late to become what you could have been ~ George Eliot
 



And what's in the Expression? Nothing that STARTS with a DOT, I hope.

Skip,

[glasses] [red][/red]
[tongue]
 
I'm sorry. txtA.text

misscrf

It is never too late to become what you could have been ~ George Eliot
 
what am I doing wrong?

Why is this code not reseting the text box? Why is it erroring on me?

How do I reset these three textbox controls on 3 slides, from a command button on the last slide?



misscrf

It is never too late to become what you could have been ~ George Eliot
 



Did you try stepping thru this code and testing what objects are being processed? Does the code get within the IF statement?
Code:
For Each mySlide In ActivePresentation.Slides
  For Each myShape In mySlide.Shapes
    If myShape.Type = msoTextBox Then
      myShape.TextFrame.TextRange.Text = ""
    End If
  Next
Next


Skip,

[glasses] [red][/red]
[tongue]
 
I would slightly modify first Skip's suggestion, as we have MSForms textbox:
Code:
Private Sub CommandButton1_Click()
Dim sld As Slide, shp As Shape, oleF As OLEFormat
On Error Resume Next
For Each sld In ActivePresentation.Slides
    For Each shp In sld.Shapes
        Set oleF = shp.OLEFormat
        If Err.Number <> 0 Then
            Err.Clear
        Else
            If TypeName(oleF.Object) = "TextBox" Then
                oleF.Object.Value = ""
            End If
        End If
    Next shp
Next sld
End Sub

combo
 
COMBO!!!!!!!! You rule! That is it, perfectly! I ran it and it works!

You are soooo awesome! May all of your development endeavors flourish!

misscrf

It is never too late to become what you could have been ~ George Eliot
 
No, no, thank you. I took this and added :
Code:
oleF.Object.BorderColor = RGB(255, 255, 255)
oleF.Object.backColor = RGB(255, 255, 255)
oleF.Object.SpecialEffect = fmSpecialEffectFlat

To make the border and and background white. This is really great. Thanks again.

misscrf

It is never too late to become what you could have been ~ George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top