Flashcard on PPT

R

Rubianob

Hi,
I want to create a PPT presentation with only one slide and one sentence on
it, under an user click, the slide is going to change the sentence but
keeping the same slide.
I have to code to select the new sentence but I do not know how to link the
click action to the writing the new sentence on the slide.

Any help will be apreciated.
 
D

David M. Marcovitz

Posting what you have might be helpful. You can see an example that uses
multiplication problems on my site by going to:

http://www.PowerfulPowerPoint.com/

Click on "Examples from Real People" and look at the first example which
is FlashCards or scroll down to Equation Solver by Peter Jordan.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
R

Rubianob

Thanks David,

This is what I have:

Sub ChangeWords()
'
'--------------------------------

upperbound = 10
lowerbound = 1
Randomize
random_number = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

Select Case random_number
Case 1
WordDisplayed = "Little"
Case 2
WordDisplayed = "Car"
Case 3
WordDisplayed = "Pig"

End Select

ActiveWindow.Selection.SlideRange.Shapes("Rectangle 7").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select

ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1,
Length:=0).Select

With ActiveWindow.Selection.TextRange
.Text = WordDisplayed
With .Font
.Name = "Arial"
.Size = 80
.Bold = msoTrue
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoTrue
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With

End Sub

When I run the presentation, the text is not updated in "Rectangle 7". Am I
doing something wrong?

Thanks for the info onthe others links.
 
D

David M. Marcovitz

I assume you want to run this code in Slide Show View. In that case, you
can't select anything. Put a button on your slide and put the text "Next
Word" or something that makes sense to you in the button. Now, you need to
identify the text box with the text you want to change. This can be done by
number or name. If you are using a standard slide with title and text, the
title area is probably shape #1, and the text area is probably shape #2. Any
additional items you add to the slide will be numbered in order (for example,
that button I told you to add will be #3 if it is the first thing you add).
Alternatively, you can go to http://www.PowerfulPowerPoint.com/ and get
Example 8.7, which will allow you to give the shapes on your slide names.
Additionally, you are already using a name in your code (all shapes start
with hard-to-remember default names), so you could use "Rectangle 7" as the
name since you are already using that. Now, I haven't tested the following
because I am working from home now, and this is just to clumsy on my old Mac,
so this might not actually work.

After your End Select (which I'm assuming works so if it doesn't, that will
have to be fixed), put something like the following instead of all the lines
starting with ActiveWindow and the first line starting with With. Leave the
rest of your code alone.

With ActivePresentation.SlideShowindow.View.Slide.Shapes("Rectangle
7").TextFrame.TextRange

Finally, create your button (if you haven't already), and make the Action
Setttings run the macro. When you go into Slide Show View, click on the
button as often as you like and watch the word change.

--David

David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
R

Rubianob

Sorry I am late on this. THANKS A LOT.

David M. Marcovitz said:
I assume you want to run this code in Slide Show View. In that case, you
can't select anything. Put a button on your slide and put the text "Next
Word" or something that makes sense to you in the button. Now, you need to
identify the text box with the text you want to change. This can be done by
number or name. If you are using a standard slide with title and text, the
title area is probably shape #1, and the text area is probably shape #2. Any
additional items you add to the slide will be numbered in order (for example,
that button I told you to add will be #3 if it is the first thing you add).
Alternatively, you can go to http://www.PowerfulPowerPoint.com/ and get
Example 8.7, which will allow you to give the shapes on your slide names.
Additionally, you are already using a name in your code (all shapes start
with hard-to-remember default names), so you could use "Rectangle 7" as the
name since you are already using that. Now, I haven't tested the following
because I am working from home now, and this is just to clumsy on my old Mac,
so this might not actually work.

After your End Select (which I'm assuming works so if it doesn't, that will
have to be fixed), put something like the following instead of all the lines
starting with ActiveWindow and the first line starting with With. Leave the
rest of your code alone.

With ActivePresentation.SlideShowindow.View.Slide.Shapes("Rectangle
7").TextFrame.TextRange

Finally, create your button (if you haven't already), and make the Action
Setttings run the macro. When you go into Slide Show View, click on the
button as often as you like and watch the word change.

--David

David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top