PDA

View Full Version : VBA help to clear text box on exit from slide



mckeown55
04-08-2013, 06:42 AM
I have written a PowerPoint quiz for young people in the church I attend. It is loosely based around the Millionaire game theme only instead I have a live text box in which the young person types in a Bible character name and then I click a button which brings up the correct spelling for comparison - however, presently when I close the quiz down and re-open on another occasion the spelling typed in by the young person remains - I want a VBA statement to ClearContents of the text box on exit to next slide even, any help greatly appreciated

Office 2003

links to the files are below?

Leonard

https://www.dropbox.com/sh/3as6kfzwzstigv6/xcifTckoVG

John Wilson
04-08-2013, 08:12 AM
Assuming all the shapes are named answersomething

Sub OnSlideShowTerminate()
Dim osld As Slide
Dim oshp As Shape
On Error Resume Next
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Name Like "answer*" Then
oshp.OLEFormat.Object.Text = ""
End If
Next oshp
Next osld
End Sub

in a normal module should do it

BTW

Do you actually know what that "extended style" code is meant to do and does it do it??? I somehow doubt it.

mckeown55
04-08-2013, 02:18 PM
sorry John -

I didn't get back quicker - I appear to have got a hard drive problem which surpasses my PowerPoint VBA problem by far at the moment, lol.

The 'extended style' code - I can't even remember doing it so unless I created it by some back door operation or by a change in the 'text box' properties, I don't know because the quiz was a complete PowerPoint started from scratch to it's present state.

Give me a day or two to get this hard drive prob sorted and I will get around to testing out your results,

many, many thanks for your prompt response,

Leonard