Shadow

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Is there a way to write a macro that will create a Perspective Shadow
diagonal upper left of every picture in a powerpoint presentation?
 
Yes.

What have you tried so far?


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Well I first tried it on a single object with

ActiveWindow.Selection.ShapeRange.Shadow.Style = msoShadowStyleMixed

and that did not work

I cannot figure out what collection perspective style is in so I
cannot assign it to a picture
 
Ok, that is a good start, even though it doesn't feel like it.

1) You need the macro to select all the shapes in the presentation one at a
time.

So I would use a routine like this:

Dim oSld as Slide
Dim oShp as shape
For each oSld in activepresentation.Slides
For Each oShp in osld.shapes
'... shapes evaluation here
next
Next


2) Then you will need to figure out what type of shape it is. If it is a
picture, then you want to add the shadow.

If oShp.type = msoPicture then
'... Do the stuff here
End if


3) The MixedShadow effects does not help when trying to apply a shadow, so
lets spell it out.

you will need to apply oshp.Shadow.Visible = True and oshp.Shadow.Type =
msoShadow2


Let us know how this works out for you or if you need additional help in
putting it all together.

--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
I already tried oshp.Shadow.Type =

and tried all of them (1-20)
None code for the Perspective Diagnol Upper left

Go figure
 
I also Try setting the following

\ ActiveWindow.Selection.ShapeRange.Shadow.OffsetX = 0
ActiveWindow.Selection.ShapeRange.Shadow.OffsetY = 0
ActiveWindow.Selection.ShapeRange.Shadow.RotateWithShape = 0
ActiveWindow.Selection.ShapeRange.Shadow.Size = 100
ActiveWindow.Selection.ShapeRange.Shadow.Transparency = 0.8

Since these were values i got from an object with a Perspective
Diagnol Upper left shadow and it created a very different shadow.
Obviously the attributes to describe this type of shadow are not it
the ActiveWindow.Selection.ShapeRange.Shadow. collection. Any idea
where they are? (Ahh a macro recorder would be nice about now)
 
Try offsetx = -10
offset y = -10

Bill D.

I also Try setting the following

\ ActiveWindow.Selection.ShapeRange.Shadow.OffsetX = 0
ActiveWindow.Selection.ShapeRange.Shadow.OffsetY = 0
ActiveWindow.Selection.ShapeRange.Shadow.RotateWithShape = 0
ActiveWindow.Selection.ShapeRange.Shadow.Size = 100
ActiveWindow.Selection.ShapeRange.Shadow.Transparency = 0.8

Since these were values i got from an object with a Perspective
Diagnol Upper left shadow and it created a very different shadow.
Obviously the attributes to describe this type of shadow are not it
the ActiveWindow.Selection.ShapeRange.Shadow. collection. Any idea
where they are? (Ahh a macro recorder would be nice about now)
 
Areyou using 2007



The shadow i want to duplicate is under format/picture effects/shadow
and the first one under perspective

Thanks for your help
 
Sorry dude, didn't see the 2007 reference.

Ok, a bit more complicated, but very doable

For oShp, you will need to set ...

.style = 2
.transparency = 0.8
.size = 25
.OffsetY = 0
.OffsetX = -0.75 * oshp.width
.visible = true
.blur = 6


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Hmm: Almost there but I am stilled stumped I tired this and got some
weird shadow

With ActiveWindow.Selection.ShapeRange.Shadow
.Style = 2
.Transparency = 0.8
.Size = 25
.OffsetY = 0
.OffsetX = 0.75 * ActiveWindow.Selection.ShapeRange.Width
.Visible = True
.Blur = 6
End With
 
Jeff, you need to assemble all the parts I gave you. Do not use
activeWindow anything, use oShp from previous examples.

Bill D.
 
Back
Top