MOUSE-OVER VB CODE (FOLLOW UP)

J

Justin

Don't know if anyone can help me with this. The other day Gaetan and Steve
R were kind enough to spellout some VB code but I realized even that was
over my head...I appreciated his feedback on my VB question the other day,
but I'm quite confused. can anyone spellout in lay-persons terms how I
execute the code below so that I can do a mouse-over color change on one of
7 rectangles on a particular slide?

Essentially I really don't know how to incorporate this code into my
powerpoint. Is there an "easy" way to explain how to assign this VB code to
a particular object on a slide (how do I determine the "Rectangle #"? Where
do I paste this information -- in the script editor or in a new Module in
the in the Visual Basic editor?)

I understand if it's too complicated to try to explain, but if possible it
would be MUCH appreciated

Either way, thanks a million.

Justin
 
G

Guest

Hi

This code should change the colour of any shape you mouse over and change it
back after a short delay. You can alter the RGB numbers to change the colour
and set the delay by changing WaitTime

Sub ChangeColor(oshp As Shape)
orig = oshp.Fill.ForeColor.RGB
oshp.Fill.ForeColor.RGB = RGB(100, 0, 100)
Wait
oshp.Fill.ForeColor.RGB = orig
End Sub

Sub Wait()
waitTime = 1
Start = Timer
While Timer < Start + waitTime
DoEvents
Wend
End Sub

The code should be pasted into a module in the vb editor (alt f11. insert
module)

Any shape you would like to change colour should have a mouseover action
setting of run macro

Note it will only work in show mode
--
Did that answer the question / help?
___________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk
 
S

Steve Rindsberg

Essentially I really don't know how to incorporate this code into my
powerpoint. Is there an "easy" way to explain how to assign this VB code to
a particular object on a slide (how do I determine the "Rectangle #"? Where
do I paste this information -- in the script editor or in a new Module in
the in the Visual Basic editor?)

This explains how to include the code in your presentation:

How do I use VBA code in PowerPoint?
http://www.pptfaq.com/FAQ00033.htm


And joHn's explained how to set a shape so that it triggers the code, so I
think you're good to go. If there are still questions, we're here; ask. 'kay?
 
S

Steve Rindsberg

John Wilson said:
"joHn's explained" - your shift key sick too Steve?

To misquote the old joke, "I'm not making fun of him. I'm making fun of you."
<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

Similar Threads


Top