I'm currently trying to make a quiz in PowerPoint using VBA.
One of my aims is to have a user enter their name in a textbox, and then have it displayed in other various textboxes throughout the powerpoint (e.g. <Name>'s score). I can get the entered name to appear in a message box, but not in another textbox, as I just get an "Object required" error.
If someone could point out what I'm doing wrong I'd greatly appreciate it. I'm hoping it's something obviously simple that I've missed or forgotten to add in.
At the minute I'm just trying to get it to appear in one textbox on Slide14.
Sub NameBoxes() 'Changes displayed name on various slides 'To the contents of the input box on slide 2 Dim InputName As String Dim NameDisplayBox As TextBox InputName = Slide2.NameBox.Text If (InputName = "") Then MsgBox ("Please enter your name.") Valid = False Else Valid = True ActivePresentation.SlideShowwindow.View.Next 'Tests InputName variable has a value MsgBox (Slide2.NameBox.Text) End If Slide14.NameDisplayBox.Text = InputName MsgBox ("It's done") End Sub
Slide14.NameDisplayBox.Text = InputName is always highlighted when I run the debugger, so I'm assuming it's something to do with that.
I'm also hoping to do the same with the user's score, so I'm assuming the process would be similar to display integer variables in a textbox also?
Thanks in advance.
This post has been edited by HappyLibrary: 01 March 2009 - 04:27 PM