Mouseover

G

Guest

The standard mouseover function under the Actions menu for an object gives a
fairly basic effect - being switch on and immediately off. Is it possible to
vary this Action so that the mouseover effect stays active while the mouse is
over an object and only turns off when the mouse leaves the object - the same
as what we see on the web every day. I'm ready if this needs some VBA script
thanks the the great intro given by you chaps in my previous question on
mouseover/swap image which is now working very well. This leads to another
question as well. Is it possible to access the standard Actions/Animations
via the VBA interface so as to customise them there?
Thanks
Chris
 
G

Guest

I would love to know the answer to this too! I hate it how my highlights
dissapear while my mouse is still hovering over the text/object I'm
highlighting. It almost defeats the purpose...
 
G

Guest

Simplest way to get this effect is to use the mouseover to hyperlink to a
near duplicate slide ( except for the extra highlights you want) On this
slide a transparent (invisible) shape can be placed behind the object so that
it protrudes beyond the object. Put a mouseover on this to return to first
slide. Asa soon as the mouse moves off the shape (onto the transparent area)
you will hyperlink back to the original slide.
--
-----------------------------------------
Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
 
S

Steve Rindsberg

The standard mouseover function under the Actions menu for an object gives a
fairly basic effect - being switch on and immediately off. Is it possible to
vary this Action so that the mouseover effect stays active while the mouse is
over an object and only turns off when the mouse leaves the object - the same
as what we see on the web every day. I'm ready if this needs some VBA script
thanks the the great intro given by you chaps in my previous question on
mouseover/swap image which is now working very well. This leads to another
question as well. Is it possible to access the standard Actions/Animations
via the VBA interface so as to customise them there?

It may depend on the effect you're after, but one approach is to have e.g. two
rectangles rather than one, stacked atop one another, with the "lower" one a wee
bit bigger than the one on top.

The upper/smaller one triggers your mouseover, but to get out of it, the mouse
has to pass through the lower/larger one, so its mouseover action is set to undo
whatever the upper one did.

For example, perhaps you want a rectangle that highlights by changing to yellow
when you mouse over. You set its mouseover action to run a macro that changes
the shape to yellow:

[AirCode Warning ... top of head in use]

Sub HighlightMe(oSh as Shape)
oSh.Fill.Forecolor = RGB(255,255,0) ' make it yellow
' and give it a name so we can grab it later
oSh.Name = "CatchMeIfYouCan"
End Sub

Then to the larger shape, you assign this macro

Sub RemoveHighlight(oSh as Shape)
Dim oSl as Slide
Set oSl = oSh.Parent

' grab the highlighted shape
With oSl.Shapes("CatchMeIfYouCan")
.Fill.ForeColor = RGB(0,0,255)
' Rename it something random
Randomize
.Name = cstr(Rnd())
End If

End Sub
 
G

Guest

Steve:

I copied your code "as is" into the VBA editor, but it didn't work. I
assigned the macros to trigger on mouse over, but nothing at all happened in
the presentation.
Is there some customization I need to do to the code before it works? Do I
have to rename the shapes? I'm not familiar with working with VB code...

Do you have a working example that you can share with me?
arthur9 @ gmail.c om

(here is a link to the powerpoint file I made:
http://download-v5.streamload.com/a...Hosted/highlight mouse over.ppt?download=true )

thanks.

art.
 
S

Steve Rindsberg

Pesky aircode.

This works:

Sub HighlightMe(oSh As Shape)
oSh.Fill.ForeColor.RGB = RGB(255, 255, 0) ' make it yellow
' and give it a name so we can grab it later
oSh.Name = "CatchMeIfYouCan"
End Sub


Sub RemoveHighlight(oSh As Shape)
Dim oSl As Slide
Set oSl = oSh.Parent

' grab the highlighted shape
On Error Resume Next
With oSl.Shapes("CatchMeIfYouCan")
.Fill.ForeColor.RGB = RGB(0, 0, 255)
' Rename it something random
Randomize
.Name = CStr(Rnd())
End With

End Sub
 
G

Guest

Hi Steve and John,

Thanks for below, this now works.

With presentation I'm doing I am already using the Swap Image code (that you
provided before) for an Action event when passing over a buttons (there
happens to be many buttons/links on this particular page).

Sub DisplayMessage(oShp As Shape)
' The shape's. Parent will be either the slide or master
' it's on; this way you don't have to worry which
With oShp.Parent.Shapes("Slide Navigator").TextFrame.TextRange
.Text = oShp.Name
DoEvents
End With
End Sub

Powerpoint will only allow me to call one Action at a time; either the Swap
Image code or Mouseover Code for a given button but not both.

Is there a way of combining the two VBA codes into one so that when you
mouse over a button, the button will swap text into and out of another text
object (as per the above code) on the slide while giving a true mouseover
event (as per the code and discussion of yesterday and today).

Thanks again

Chris
 
S

Steve Rindsberg

With presentation I'm doing I am already using the Swap Image code (that you
provided before) for an Action event when passing over a buttons (there
happens to be many buttons/links on this particular page).

Sub DisplayMessage(oShp As Shape)
' The shape's. Parent will be either the slide or master
' it's on; this way you don't have to worry which
With oShp.Parent.Shapes("Slide Navigator").TextFrame.TextRange
.Text = oShp.Name

' How about inserting this here:
HighlightMe(oShp)
 
G

Guest

Hi Steve.
Unfortunately no luck with the extra code:

HighlightMe(oShp)

I found that when I pasted it in it stopped the text appearing in the second
box altogether when I did the mouseouver in 'Show' mode.

I noticed when I pasted the code where shown in the script module that a
blank space was automatically inserted between HighlightMe and (oShp).
I don't know if this is supposed to happen or not.
I tried deleting the space and even retyping but the space would always come
back.
I mentioned the other post if it was possible to get a swap image happening
as well.

This would mean as you moused over a button:
- text would appear in text box which would descibe an image appearing in a
separate picture box
- the button would hihjlight tp reflect the mouseover as above.
Can this all be done in the one script as you can only assign one action to
a mouseover event.
Thanks again
Chris

Hi David,
I checked out the Hover Button and there's a fair bit there for me to digest.
I look into it further tomorrow morning.
Thanks for your help
Chris
 
D

David M. Marcovitz

Here's the deal on the space. Parentheses are used for a number of
different things in VBA. Sometimes parentheses are necessary. Sometimes,
there are things that are very very similar, some of which need
parentheses, some of which don't. When you supply parameters to a
function, you need parentheses. When you supply parameters to a
procedure, you don't. The difference between a function and a procedure
is that a function returns a value, and a procedure doesn't. This gets
some added confusion because some built-in things can act as functions
and procedures.

For example, MsgBox can return a value (a code for which button was
pressed), so if you are going to use the value, you will have to use the
parentheses. For example,

MsgBox "hello"
whatsClicked = MsgBox("hello")

The first line does not require parentheses while the second line does.

At this point, you might be asking, What does all this have to do with
spaces. The answer is simple, if you use parentheses when you don't need
to, VBA will automatically put a space before the parentheses. For
example, it will change:

MsgBox("hello")

into

MsgBox ("hello")

The bottom line is that you shouldn't really worry about it, and if you
are not sure when to use parentheses, just use them, and you should be
OK. In my book, I always use parentheses and don't worry about making
this distinction because unless you notice the added space, you won't
really care.

--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/
 
S

Steve Rindsberg

Hi ...

At this point, there are bits of code and explanations strewn all throughout the
thread and I've lost track of some of 'em, I think. Too many little projects at
this end, too little gray matter to cope with it all, I'm afraid. ;-)

Can you consolidate the code and requirements into one message (or better yet, put
it into a semi-nearly-working PPT that you can post on a web site someplace for us
to grab)?


Hi Steve.
Unfortunately no luck with the extra code:

HighlightMe(oShp)

I found that when I pasted it in it stopped the text appearing in the second
box altogether when I did the mouseouver in 'Show' mode.

I noticed when I pasted the code where shown in the script module that a
blank space was automatically inserted between HighlightMe and (oShp).
I don't know if this is supposed to happen or not.
I tried deleting the space and even retyping but the space would always come
back.
I mentioned the other post if it was possible to get a swap image happening
as well.

This would mean as you moused over a button:
- text would appear in text box which would descibe an image appearing in a
separate picture box
- the button would hihjlight tp reflect the mouseover as above.
Can this all be done in the one script as you can only assign one action to
a mouseover event.
Thanks again
Chris

Hi David,
I checked out the Hover Button and there's a fair bit there for me to digest.
I look into it further tomorrow morning.
Thanks for your help
Chris

Steve Rindsberg said:
With presentation I'm doing I am already using the Swap Image code (that you
provided before) for an Action event when passing over a buttons (there
happens to be many buttons/links on this particular page).

Sub DisplayMessage(oShp As Shape)
' The shape's. Parent will be either the slide or master
' it's on; this way you don't have to worry which
With oShp.Parent.Shapes("Slide Navigator").TextFrame.TextRange
.Text = oShp.Name

' How about inserting this here:
HighlightMe(oShp)
DoEvents
End With
End Sub

Powerpoint will only allow me to call one Action at a time; either the Swap
Image code or Mouseover Code for a given button but not both.

Is there a way of combining the two VBA codes into one so that when you
mouse over a button, the button will swap text into and out of another text
object (as per the above code) on the slide while giving a true mouseover
event (as per the code and discussion of yesterday and today).

Thanks again

Chris

:

Pesky aircode.

This works:

Sub HighlightMe(oSh As Shape)
oSh.Fill.ForeColor.RGB = RGB(255, 255, 0) ' make it yellow
' and give it a name so we can grab it later
oSh.Name = "CatchMeIfYouCan"
End Sub


Sub RemoveHighlight(oSh As Shape)
Dim oSl As Slide
Set oSl = oSh.Parent

' grab the highlighted shape
On Error Resume Next
With oSl.Shapes("CatchMeIfYouCan")
.Fill.ForeColor.RGB = RGB(0, 0, 255)
' Rename it something random
Randomize
.Name = CStr(Rnd())
End With

End Sub


http://download-v5.streamload.com/a2e02f0b-7322-4615-a3e5-93fb9a365053/dawgma2/Host
ed/highlight%20mouse%20over.ppt?download=true )
 
G

Guest

Hi Steve/David
Yes you are correct. I don't have immediate access to web space where I
could host a PowerPoint file. Could I make a simplistic version and email to
one or both of you to look at?
Regards
Chris

Steve Rindsberg said:
Hi ...

At this point, there are bits of code and explanations strewn all throughout the
thread and I've lost track of some of 'em, I think. Too many little projects at
this end, too little gray matter to cope with it all, I'm afraid. ;-)

Can you consolidate the code and requirements into one message (or better yet, put
it into a semi-nearly-working PPT that you can post on a web site someplace for us
to grab)?


Hi Steve.
Unfortunately no luck with the extra code:

HighlightMe(oShp)

I found that when I pasted it in it stopped the text appearing in the second
box altogether when I did the mouseouver in 'Show' mode.

I noticed when I pasted the code where shown in the script module that a
blank space was automatically inserted between HighlightMe and (oShp).
I don't know if this is supposed to happen or not.
I tried deleting the space and even retyping but the space would always come
back.
I mentioned the other post if it was possible to get a swap image happening
as well.

This would mean as you moused over a button:
- text would appear in text box which would descibe an image appearing in a
separate picture box
- the button would hihjlight tp reflect the mouseover as above.
Can this all be done in the one script as you can only assign one action to
a mouseover event.
Thanks again
Chris

Hi David,
I checked out the Hover Button and there's a fair bit there for me to digest.
I look into it further tomorrow morning.
Thanks for your help
Chris

Steve Rindsberg said:
With presentation I'm doing I am already using the Swap Image code (that you
provided before) for an Action event when passing over a buttons (there
happens to be many buttons/links on this particular page).

Sub DisplayMessage(oShp As Shape)
' The shape's. Parent will be either the slide or master
' it's on; this way you don't have to worry which
With oShp.Parent.Shapes("Slide Navigator").TextFrame.TextRange
.Text = oShp.Name

' How about inserting this here:
HighlightMe(oShp)

DoEvents
End With
End Sub

Powerpoint will only allow me to call one Action at a time; either the Swap
Image code or Mouseover Code for a given button but not both.

Is there a way of combining the two VBA codes into one so that when you
mouse over a button, the button will swap text into and out of another text
object (as per the above code) on the slide while giving a true mouseover
event (as per the code and discussion of yesterday and today).

Thanks again

Chris

:

Pesky aircode.

This works:

Sub HighlightMe(oSh As Shape)
oSh.Fill.ForeColor.RGB = RGB(255, 255, 0) ' make it yellow
' and give it a name so we can grab it later
oSh.Name = "CatchMeIfYouCan"
End Sub


Sub RemoveHighlight(oSh As Shape)
Dim oSl As Slide
Set oSl = oSh.Parent

' grab the highlighted shape
On Error Resume Next
With oSl.Shapes("CatchMeIfYouCan")
.Fill.ForeColor.RGB = RGB(0, 0, 255)
' Rename it something random
Randomize
.Name = CStr(Rnd())
End With

End Sub


http://download-v5.streamload.com/a2e02f0b-7322-4615-a3e5-93fb9a365053/dawgma2/Host
ed/highlight%20mouse%20over.ppt?download=true )
 
S

Steve Rindsberg

Hi Steve/David
Yes you are correct. I don't have immediate access to web space where I
could host a PowerPoint file. Could I make a simplistic version and email to
one or both of you to look at?

Sure, that'd be fine.

steve at-sign pptools dot com


Regards
Chris

Steve Rindsberg said:
Hi ...

At this point, there are bits of code and explanations strewn all throughout the
thread and I've lost track of some of 'em, I think. Too many little projects at
this end, too little gray matter to cope with it all, I'm afraid. ;-)

Can you consolidate the code and requirements into one message (or better yet, put
it into a semi-nearly-working PPT that you can post on a web site someplace for us
to grab)?
 
G

Guest

Thanks Steve,
Yes I have received your email with the amended PowerPoint.
It will take me a couple of days to digest it and try to come to grips with
the code you provided (in between other things etc).
I think I need to simplify the presentation further because in its current
state it's a little hard to manage - as far as trying to learn from it.
I submitted the presentation I was working on using the code you previously
provided and it went over very well.
Thankyou for all your help.
I'll post my reply in a few days.
Chris
 
S

Steve Rindsberg

Thanks Steve,
Yes I have received your email with the amended PowerPoint.
It will take me a couple of days to digest it and try to come to grips with
the code you provided (in between other things etc).
I think I need to simplify the presentation further because in its current
state it's a little hard to manage - as far as trying to learn from it.

That, and if you follow through the amended mouseover event code, it's having to do quite a lot
now, and do it each time the mouse moves over the "trigger" shapes. On a slow system, the
response can get quite sluggish. Also, on my end it tends to bounce between two adjacent
shapes; it appears to be triggering back and forth between them, which really slows things down.
That's why you'll notice that I enlarged the shapes on the version I sent back to you.

Ah, and there are also a few stray shapes in that same area on a few of the slides; they seem
to have a mouseover action setting applied, which causes errors. I've deleted them but if you
revert to a different version of the presentation, you'll want to delete them there as well.
 
G

Guest

Yes I was wondering if we were reaching the limits of what PowerPoint was
comfortable in handling. I was already experiencing some unexpected effects
in the presentation that I recently completely. The swap image text labels
tend to 'bounce' if you move over them too quickly. That is if I move from
trigger event A to event B quickly I find that the text description changes
from 'A' to 'B' as you would expect then bounces back to 'A' momentarily
before settling on 'B'. It seems this type of approach may be impactical for
presentations with lots of slides, or buttons that are positioned too close
together. It would still be nice to get to work for simpler presentations.
Just a thought, apart from Flash, have you come across any other presentation
type software that can do the things we're talking about here.
Regards
Chris
 
S

Steve Rindsberg

Yes I was wondering if we were reaching the limits of what PowerPoint was
comfortable in handling. I was already experiencing some unexpected effects
in the presentation that I recently completely. The swap image text labels
tend to 'bounce' if you move over them too quickly. That is if I move from
trigger event A to event B quickly I find that the text description changes
from 'A' to 'B' as you would expect then bounces back to 'A' momentarily
before settling on 'B'. It seems this type of approach may be impactical for
presentations with lots of slides, or buttons that are positioned too close
together. It would still be nice to get to work for simpler presentations.
Just a thought, apart from Flash, have you come across any other presentation
type software that can do the things we're talking about here.

Afraid I have my hands full just keeping up with PPT w/o tackling others <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

Top