PowerPoint tips, hints and tutorials that will change your presentations for ever!



Custom Shows
vba code
Games for teachers
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Set spellcheck language

Home buttonTutorial buttonContact buttonProducts button

Type a Name During a Show and Have it Appear In a Later Slide

Once people discover that you can type into a control textbox DURING a show they often want to use the name typed in a later slide. A common use would be  a quiz or survey where the user's name appears later in a certificate slide.

How To Do This

First you will need to access the control toolbox so that you can insert the control Textbox. In 2007 onwards the easiest way is to show the DEVELOPER Tab on the ribbon.

2007: Office Button > PowerPoint Options > Popular > Show Developer Tab

2010: File > Options > Customise ribbon > Tick 'Developer' in the RIGHT Pane

2003: View > Toolbars > Control toolbox

In each case choose TextBox and insert onto your slide. The default name will be TextBox1.

Control TextBox

Now RIGHT click and View code. You will see two line of code already added. Add the code below to get this (copy and paste)

Private Sub TextBox1_Change()

Dim osld As Slide
Set osld = ActivePresentation.Slides(ActivePresentation.Slides.Count)
If osld.Shapes(1).HasTextFrame Then _
osld.Shapes(1).TextFrame.TextRange = Me.TextBox1

End Sub

Take a note of the name of the Slide Object. NOTE the name does NOT correspond to the actual slide number. Slide1 can easily actually be on Slide1, Slide 7 or Slide 100

Slide Object Name

Lets See What This Does!

The first line declares a slide variable called osld
The second sets this variable to the LAST slide
IF Shape 1 on this last slide has a TextFrame (ie can hold text) the text is set to the current text in the control textbox every time that text changes.

At the End of the Show.

You probably need the TextBox to be cleared for the next user. Here's how to do that.

Press ALT f11 to get to the VB editor and INSERT > Module

Copy this code into that module. If the name of the slide object was NOT Slide1 then adapt the code to show the actual name.

Sub OnSlideShowTerminate()
Slide1.TextBox1.Text = ""
End Sub

Download a simple demo



Back to the Index Page


Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation