using OnLoad for a slide in Powerpoint (2003)?

  • Thread starter Thread starter riddle171
  • Start date Start date
R

riddle171

I have a label that changes per some hotspots I put in. I want a label
to reset either after the person moves on to the next slide or before
the slide loads.

Problem is I programmed the hotspots to change the caption but when the
person goes to the next slide the caption stays on the last one used.
I want to have it blank when the user enters that slide.

I can write some code (I am not very good at all) so that it will reset
the label when the slide loads?

-Stoss
 
I have a label that changes per some hotspots I put in. I want a label
to reset either after the person moves on to the next slide or before
the slide loads.

Problem is I programmed the hotspots to change the caption but when the
person goes to the next slide the caption stays on the last one used.
I want to have it blank when the user enters that slide.

I can write some code (I am not very good at all) so that it will reset
the label when the slide loads?

Probably; but instead of thinking in terms of making something happen when the
slide loads, think about making it happen when you click the button that goes
to that slide.

Next, can you explain what you need in powerpoint terms? PPT doesn't have
anything called labels or hotspots, so I'm not sure how you've created these.
 
Labels are in the 'Control Toolbox'.

'Hotspots' are when you take a rectangle box place it around something
(borders = nothing (i.e. Invisible)) and place it over a place on the
slide. Example: let's say I have a photograph of a farm. I could take
a rectangle box and put it around a barn. Then, I would create a macro
and launch the macro when the person either mouseovers or clicks that
barn (actually they would be clicking the rec. box) using the 'Action
Settings'. Then, having a label say, "This is the little red barn"
(the programmed macro changes the caption). I know, dumb analogy :-)

However, using this example, if I go to the next slide2 the caption in
the label (slide1) will state, "This is the little red barn" the next
time you open and go to that slide.

I can do what I want from a previous slide. In other words, what you
said before about thinking about what you click before you get to the
slide. If I want to reset some values (labels) in slide 2, I could set
it to do that from slide 1. If this way is possible, I could do that
in my PPT. However, I just don't know how :(

Any help would be great!
-Stoss
 
Labels are in the 'Control Toolbox'.

'Hotspots' are when you take a rectangle box place it around something
(borders = nothing (i.e. Invisible)) and place it over a place on the
slide. Example: let's say I have a photograph of a farm. I could take
a rectangle box and put it around a barn. Then, I would create a macro
and launch the macro when the person either mouseovers or clicks that
barn (actually they would be clicking the rec. box) using the 'Action
Settings'. Then, having a label say, "This is the little red barn"
(the programmed macro changes the caption). I know, dumb analogy :-)

Nope, *simple* analogy. Them's the best kind. <g>

And now I understand exactly what you mean, so it musta been a good analogy
too. Thanks.

In a computerized world, why do we use analogies instead of digitalies? Never
mind. Don't think about that. It'll just make your head hurt.
However, using this example, if I go to the next slide2 the caption in
the label (slide1) will state, "This is the little red barn" the next
time you open and go to that slide.

What I'd consider doing is:

Create a first "opening/welcome" slide with a "Click to start" button; user
has to click the button to begin, when they click the button it triggers a
macro that does any resetting you need (ie, changes all the labels and stuff
back to their default states). Tell me what you'll have on the slides in
question and what the default state should be.

I'd probably use tags for this. For example, select a text box and run this:

With ActiveWindow.Selection.ShapeRange(1)
.Tags.Add "LABEL", "This is the default text"
End With

Then your start button macro could be along the lines of (warning, air code):

Sub StartMeUp()

Dim oSh as Shape
Dim oSl as Slide

' Reset each text label to its default text value
For each oSl in ActivePresentation.Slides
For Each oSh in oSl.Shapes
if oSh.Tags("LABEL") <> "" Then
oSh.TextFrame.TextRange.Text = oSh.Tags("LABEL")
End if
Next
Next
End Sub

OBTW, any special reason for using a label and not a regular PPT text box?
Text boxes are simpler to work with and will work cross-platform.

Next, you want to name each of the shapes you have to work with (makes them
much simpler to get at via code). Here's a link that shows you how to do that:

Edit the name of a shape
http://www.rdpslides.com/pptfaq/FAQ00584.htm

Then a macro can easily "locate" the shape.

With ActivePresentation.Slides(1).Shapes("MyName")
' do whatever
End With
 
Thanks so much for your help. You pointed me in the right direction.

Basically, this is what I did..... I created a start button on the
first slide to start the slide show.

(I really stink at coding so just laugh behind my back LOL)

Private Sub cmdStart_Click()
With ActivePresentation.Slides(19).Shapes("lblPFDInfoBox")
Slide20.lblPFDInfoBox.Caption = ""
Slide20.lblPFDInfoBox.Visible = False
End With
With ActivePresentation.Slides(7).Shapes("lblControlPanel")
Slide8.lblControlPanel.Visible = True
Slide8.lblControlPanel.Caption = "Please mouseover any control
for more information."

'I didn't know how to run this next line of code by itself so I stuck
it here to run since these lines where running anyway. It didn't seem
to want to run outside of the With statement. I know this is horible
code, I am a flight instructor, not a coder.
'This code take you to slide 2 in my PPT
ActivePresentation.SlideShowWindow.View.Next
End With
End Sub

At any rate, you kind of lost me a little bit with the code you wrote
down. I mean, I pretty much can read and understand the code but I am
not sure what the end goal was.

Anyway, you have been a HUGE help. I have learned a little more about
powerpoint. I am a little surprised at MS for making powerpoint as
difficult to work with as it is. Just knowing other MS programs,
trying to customize PPT with VBA has been a lot harder than any other
program.

Oh, BTW: the code that I did got me to the point that everything works
exactly how I want it to. I know it isn't pretty but I don't have the
time to really dig down to understand and make it pretty, nice code.

Thanks again!!!!!!
If you ever want flying lessons, just let me know :-) (I'll still
charge you, I will just be extra nice to ya!!!!! LOL)
-Stoss
 
Thanks so much for your help. You pointed me in the right direction.

Basically, this is what I did..... I created a start button on the
first slide to start the slide show.

(I really stink at coding so just laugh behind my back LOL)

You're already laughing said:
At any rate, you kind of lost me a little bit with the code you wrote
down. I mean, I pretty much can read and understand the code but I am
not sure what the end goal was.

Sorry, wasn't sure how much coding you've done.

The general idea was this:

PPT lets you "tag" shapes with bits of random information, kind of like being
able to put stickynotes on them. So for instance, you could "tag" each label
in the presentation in a way that lets you distinguish it from shapes that
aren't labels, and the tag "value" can be the default text. So once youv'e
done the initial work of tagging each label, a simple bit of code can step
through all the shapes in the presentation, locate those that are your labels
and reset the text in them to default. Neat.
If you ever want flying lessons, just let me know :-) (I'll still
charge you, I will just be extra nice to ya!!!!! LOL)
-Stoss

<g>
 

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

Back
Top