Layering Objects

S

SteveK

On each slide I am bringing into PP 2003 a few pictures, a few arrows, and a
few text boxes. In order from front to back I want the pictures to be on
the bottom, then the arrows above them and then the text boxes to be on top
so that they can cover the end of the arrow and cover the picture. I have
recorded macros to bring the objects in and I have recorded these commands
to set the order when the objects come in:

For the text box that I want to stay on the top I have:

ActiveWindow.Selection.ShapeRange.ZOrder msoBringToFront

For the arrow that would be under the text box but above the picture I have:

ActiveWindow.Selection.ShapeRange.ZOrder msoBringToFront
ActiveWindow.Selection.ShapeRange.ZOrder msoSendBackward

For the picture I have;

ActiveWindow.Selection.ShapeRange.ZOrder msoSendToBack


This only works if I bring the picture in first, then the arrow, then the
text box.

If I bring in the picture first, then the text box, then the arrow - the
arrow sits on top of the text box.

Is there any way to control this so that I always get the priority of layers
that I want, not dependent on when the objects were placed?

Steve
 
S

SteveK

Hi Steve,

As I don't know much (anything really) about writing VBA I have instead just
been using the macro recorder to capture my keyboard input and then editing
the code that it captures. So I don't know how to give a shape a name.
Here is an example of an arrow that I selected using the AutoShape tool. I
set an outline line weight, color and fill for it all by using the drawing
tools.

Sub Arrow_white()
'
' Macro recorded 1/31/2005 by sk
'

ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRightArrow,
114#, 234#, 96#, 24#).Select
With ActiveWindow.Selection.ShapeRange
.Fill.ForeColor.SchemeColor = ppBackground
.Fill.Visible = msoTrue
.Fill.Solid
End With
With ActiveWindow.Selection.ShapeRange
.Line.ForeColor.SchemeColor = ppForeground
.Line.Visible = msoTrue
End With
With ActiveWindow.Selection.ShapeRange
.Line.Weight = 1.5
.Line.Visible = msoTrue
.Line.Style = msoLineSingle
End With
ActiveWindow.Selection.ShapeRange.ZOrder msoBringToFront
ActiveWindow.Selection.ShapeRange.ZOrder msoSendBackward
ActiveWindow.Selection.Unselect
End Sub


Steve Krause
 
S

SteveK

I'm wondering whether you guys will see this post, as it is a followup from
the thread I started and stopped a few weeks back... but here goes:

As mentioned I want to bring in objects like pictures, arrows, and text
boxes and have them always layered so that the all pictures are below all
arrows, and all arrows are below all text boxes. When I use the macro
recorder to make macros that bring in the shapes that I have recorded I can
bring in the objects but they are not layered correctly. It has been
suggested (below) that I rename the shapes that I bring in. It took me a
bit of time to understand what that suggestion implied.

I think it implies that by naming the shapes I can keep track of them and
keep a running count of how many of each shape there are in the file and
then use VBA to set the amount of go-up-one-level commands to make sure all
arrows are above all pictures. For example if there are twenty pictures in
the file, if all arrows are brought in with twenty go-up-one-level commands
then they will always sit on top of any pictures. Is this why I would want
to use the rename shapes code?

SteveK
 
S

SteveK

Hi,

I will pass this by my friend who is helping with this to see how it works.
It may be a while before I get a chance to do this.

Thanks,
Steve
 

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