-1

I'm working on a PowerPoint presentation in which I need to add information on the screen during the actual presentation, i.e. information provided by those attending the presentation.

So I have added a textbox from the Developer Tab and I'm able to enter data during the presentation. No problem.

But can I then maintain that data which I have input when I click onto a new slide?

When I move on to the next slide, the information which I have entered disappears. Is there a way to keep it in slides which come after?

Thanks in advance.

1

The information doesn't disappear as such; it'll still be there when you go back to the slide where you originally entered it. It just won't automatically appear in an ActiveX text box on other slides.

The text box's Lost Focus event will fire when you move from one slide to the next, so some code in the Lost Focus event could look at each slide in the presentation, accumulate any text in any text box control, then make the text in each text box match the accumulated text.

This isn't perfect but if you want to have a go at it, it's a start. Apply this code to the LostFocus event of each control. For more help with it, post questions to StackOverflow with Powerpoint and VBA tags rather than here:

Private Sub TextBox1_LostFocus()

    Dim oSl As Slide
    Dim oSh As Shape
    Dim sText As String

    On Error Resume Next
    ' Accumulate text from all ActiveX text boxes
    For Each oSl In ActivePresentation.Slides
        For Each oSh In oSl.Shapes
            If oSh.Type = msoOLEControlObject Then
                sText = sText & oSh.OLEFormat.Object.Text
            End If
        Next
    Next

    ' Apply the accumulated text
    For Each oSl In ActivePresentation.Slides
        For Each oSh In oSl.Shapes
            If oSh.Type = msoOLEControlObject Then
                oSh.OLEFormat.Object.Text = sText
            End If
        Next
    Next

End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.