Mouseover with two VBA events

G

Guest

Hi Steve,

I hope you don't mind me raising the topic again but I was hoping to find
out if my query relating to mouseovers was first of all 'doable' and secondly
if I could borrow some of your time in achieving a solution.

You will remember resolving my first query in getting a mouseover event to
swap text regardles of being on a master or presentation slide.

The followup to this is setting up a highlight on the button that stays
active while the mouse hovers over the button rather than quickly switching
off in the default PowerPoint fashion.

I know you provided a solution for this but I was hoping this VBA script
could be combined with the swap text VBA solution as PowerPoint only allows
for one mouseover event at a time.

The original VBA script was:

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



And the most recent script is:

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


I've had a crack at combining the two into one consolidated VBA script but
without success.

I would really appreciate your assistance if you have the time.

Thanks

PFX
 
G

Guest

Hi Steve,
Thanks for getting back to me.
Whenever you've got some time to have a look at it would be great.
Regards
Chris
 
G

Guest

Hi Steve,

Just wondering if you've had a chance to have a look at my query. I
appreciate that you're giving your time freely.
I understand that this query requires a little more investigation than usual.
There is another part to it that may or may not have an easier/more
immediate solution.
Is it possible for the mouseover event to trigger not only the swapping of
text in another box but also swapping of an image in a second location. As
the mouse passes over a button, a picture appears in a separate location and
the text describing the picture also appears in a separate box.
Hope this is possible either with or without the button highlight in my
query below.
If the above is not immediately possible it would be good to know the code
for mouseover - swap image, as against the code for mouseover - swap text as
you have already provided. If you have a VBA in PowerPoint book, I'll buy it!
My followup query is prompted by a closing deadline for this (major) project.
Thanks for your time and responses.
Chris
 
D

David M. Marcovitz

On my Web site, I have added a mouse over "swapping event." Actually, it
doesn't involve swapping, but it easily could. I simply have one picture
cover up another one (as an example of a hover button). Just go to my Web
site:

http://www.PowerfulPowerPoint.com/

Click on "More Tricks" and look for Trick #10.

As for your question about having one mouse over do two things, that is
the beauty of VBA. A mouse over will only run one macro, but that macro
can do as many things as you want (including calling other macros).

As far as books go, unfortunately, there aren't a lot of choices. There
is only one book that really focuses on VBA and PowerPoint. It's not
complete and comprehensive, but it works for beginners to get started
writing macros like the ones you are describing. The examples on my site
under "Examples by Chapter" are from the book. The book contains
descriptions of how the examples work, so if you like what you see on the
site, then click on "Buy the Book."

--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 Steve,

Just wondering if you've had a chance to have a look at my query. I
appreciate that you're giving your time freely.
I understand that this query requires a little more investigation than usual.
There is another part to it that may or may not have an easier/more
immediate solution.
Is it possible for the mouseover event to trigger not only the swapping of
text in another box but also swapping of an image in a second location. As
the mouse passes over a button, a picture appears in a separate location and
the text describing the picture also appears in a separate box.
Hope this is possible either with or without the button highlight in my
query below.

It should be, so long as the mouseover triggers a macro. The macro can do pretty much
whatever you need it to.
 

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

Similar Threads


Top