macro problem in slideshow

W

willogee

I'm using PowerPoint 2007

I've created a simple macro to turn a picture to grayscale when I mouseover
a shape. Macro works fine in Normal view, but when I'm in slideshow it
doesn't work. Macro's are enabled OK I believe.

Thanks in advance for any ideas on this.

Will
 
W

willogee

I should have included the code, as follows

Sub mouseover_telecell()
ActiveWindow.Selection.SlideRange.Shapes("Picture
7").PictureFormat.ColorType = msoPictureGrayscale
End Sub

Will
 
J

John Wilson

hi willogee

That looks like recorded code?

Code recorded in edit view often fails in show view as the model is
different. In particular any code with ".Selection" will never work in show
mode.

Try this code

Sub grey(opic As Shape)
If opic.Type = msoPicture Then _
opic.PictureFormat.ColorType = msoPictureGrayscale
End Sub

Give any picture to be affected a mouseover action of run macro
--
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
W

willogee

John

Many thanks. Yes, I'm new to macro's in powerpoint and completely lost
really without the record capability. So I fired up an old version, did a
record, and copied the code into 2007. Obviously that's not the thing to do.

I got your suggested code to work, but what I'm really really trying to do
is have the other pictures on the slide, other than the one I'm hovering
over, go to grayscale i.e. to give the effect of focus on the one I'm
hovering on (prior to linking to another page).

So how do I "select" objects I want to do things to in show mode?

Thanks again
Will
 
J

John Wilson

Hi

In 2007 it's easy to name shapes in the selection pane. Use the names to
select which go grey eg if there are four shapes named "Pic 1","Pic2" etc on
slide 1 use this to set all to grey and then the mouseover shape back

Sub picgrey(opic As Shape)
Dim i As Integer
For i = 1 To 4
ActivePresentation.Slides(1).Shapes("Pic" & CStr(i)) _
..PictureFormat.ColorType = msoPictureGrayscale
Next i
opic.PictureFormat.ColorType = msoPictureAutomatic
End Sub
--
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
W

willogee

John

Brilliant help - thanks.

The only thing not quite right is that the pictures don't revert to usual
colored state when the mouse moves off the hover image?

But really appreciate your input.

Will
 
D

David M. Marcovitz

There is no easy way to fire a macro when your mouse goes off a shape.
The easiest thing to do is to have another button behind the pictures,
set to 99% transparent. This other button will run a macro that resets
the pictures to their original state. That way, when you move off a
picture, it will move onto this mostly transparent button and fire this
other macro.
--David
 
T

T Lavedas

There is no easy way to fire a macro when your mouse goes off a shape.
The easiest thing to do is to have another button behind the pictures,
set to 99% transparent. This other button will run a macro that resets
the pictures to their original state. That way, when you move off a
picture, it will move onto this mostly transparent button and fire this
other macro.
--David

Maybe something like this ...

Sub GoGrey(oPic As Shape)
For Each aShape In oPic.Parent.Shapes
If aShape.Type = oPic.Type Then
If aShape.Name <> oPic.Name Then
aShape.PictureFormat.ColorType = msoPictureGrayscale
Else
aShape.PictureFormat.ColorType = msoPictureAutomatic
End If
End If
Next
End Sub

Sub ClrGrey(oPic As Shape)
For Each aShape In oPic.Parent.Shapes
If aShape.Type = 13 Then
aShape.PictureFormat.ColorType = msoPictureAutomatic
End If
Next
End Sub

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
 

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