First off:
I would recommend setting the presentation up as a KIOSK (if you haven't
already). This will ensure the user has to use buttons you provide. On
Slide 1 have a "Start" button that opens the UserForm1 and collects the
information. On the "OK" button of the form have the information be put
into the desired variables (code sample provided below).
You need to know the name of the object on the desired slide to control what
it contains. See code below! Some variable names are assumed.
1. First step is to copy and paste the following macro into your Module.
You would select your object on Slide 4, click "Tools", "Macro", "Macros",
select the "NameShape" macro, then click "Run". PowerPoint assigned a name
to your shape. Type over the name with your name (like, "FirstName", etc.),
then press ENTER.
Sub NameShape()
Dim Name$
On Error GoTo AbortNameShape
If ActiveWindow.Selection.ShapeRange.Count = 0 Then
MsgBox "No Shapes Selected"
Exit Sub
End If
Name$ = ActiveWindow.Selection.ShapeRange(1).Name
Name$ = InputBox$("Give this shape a name", "Shape Name", Name$)
If Name$ <> "" Then
ActiveWindow.Selection.ShapeRange(1).Name = Name$
End If
Exit Sub
AbortNameShape:
MsgBox Err.Description
End Sub
2. Second step is to obtain the information they typed on the UserForm. I
will assume you already have that down pat. If not, holler back and I will
send some sample code. What I normally do is to verify some of the
information on the form, then call a macro to assign the text strings to the
desired variables in my module. This is why I normally use the "Public"
declaration instead of "Dim". With that said, one of your lines of code
behind the "OK" button will say - AssignName (which takes the data and ports
it to the desired object on the desired slide).
=====Code sample====
'Declarations
Public strLastName as String
Public strFirstName as String
' This assumes you have two variables as listed above and the two text boxes
on your UserForm are txtFirstname and txtLastName
Sub AssignName()
strFirstName = UserForm1.txtFirstName.Text
strLastName = UserForm1.txtLastName.Text
ActivePresentation.Slides(4).Shapes("FirstName").TextFrame.TextRange.Text =
strFirstName
ActivePresentation.Slides(4).Shapes("LastName").TextFrame.TextRange.Text
= strLastName
End Sub
If you only have one shape and want both strings in it, then simply
concatenate the two strings (strFirstName & strLastName)
Holler back if this doesn't make sense!