Group:  Microsoft Word ยป microsoft.public.word.drawing.graphics
Thread: Placing an object at a specified layer

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Placing an object at a specified layer
Keith Howell 30.07.2006 09:09:02
I had a go at drawing a Kingfisher last night and found that when I wanted to
push a new shape into position in amongst existing ones, the only option I
had was to continually choose Draw/Order/Send Backward.

My suggestion is being able to "spot" and existing object and then choose to
feed the new object in behind it

(Kingfisher not qutie finished yet but at :
homepages.tesco.net/keithhowell/ArtGallery/Kingfisher.htm
)

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/community/en-us/default.mspx?mid=65283fa3-d446-4944-b5d0-cfc469f4eaa4&dg=microsoft.public.word.drawing.graphics
Re: Placing an object at a specified layer
"Ken Johnson" <KenCJohnson[ at ]gmail.com> 31.07.2006 07:26:44
Keith Howell wrote:
[Quoted Text]
> I had a go at drawing a Kingfisher last night and found that when I wanted to
> push a new shape into position in amongst existing ones, the only option I
> had was to continually choose Draw/Order/Send Backward.
>
> My suggestion is being able to "spot" and existing object and then choose to
> feed the new object in behind it

Hi Keith,

Sounded to me like a problem that could be dealt with using a macro.

If you're not a macro hater then try this one out. All you have to do
is select both shapes, the one to be tucked under (click) and the
target shape (control click), then run the macro code (keyboard
shortcut to speed things up).

The code first checks that only two shapes have been selected. It then
uses an appropriate loop to repeatedly decrease the higher shape's
zorderposition value until it is directly below the other shape.

Public Sub TuckUnder()

If Application.Selection.ShapeRange.Count <> 2 Then
MsgBox _
"Please select two Shapes before running this macro."
Exit Sub
End If

Select Case Application.Selection.ShapeRange. _
Item(1).ZOrderPosition
Case Is > Application.Selection.ShapeRange. _
Item(2).ZOrderPosition
'Item (1) is higher
With Application.Selection.ShapeRange.Item(1)
While .ZOrderPosition > _
Application.Selection.ShapeRange.Item(2) _
.ZOrderPosition
.ZOrder msoSendBackward
Wend
End With

Case Else
'Item(2) is higher
With Application.Selection.ShapeRange.Item(2)
While .ZOrderPosition > _
Application.Selection.ShapeRange.Item(1) _
.ZOrderPosition
.ZOrder msoSendBackward
Wend
End With
End Select
End Sub

The best place to keep the code is with the Normal document template so
that it is accessible within all of your documents.

To get the code in place...

1. Copy it

2. Back in Word press Alt + F11 or go Tools|Macro|"Visual Basic Editor"
to get into the Visual Basic Editor

3. In the Visual Basic Editor go View|"Project Explorer" (the Project
Explorer was more than likely already visible, this just ensures its
visibility). The Project Explorer is a tree diagram in which you should
see an icon labelled "Normal". Click on Normal then go Insert|Module. A
new blank module will appear. Paste the code into this module.

4. Save then press Alt + F11 or go File|"Close and Return to Microsoft
Word" to get back to Word

5. For the macro to be used your Macro Security will need to be set to
Medium, which gives the user the choice of either "Enabling Macros" or
"Disabling Macros" every time the document is opened. If your Security
is High or Very High macros are automatically disabled. To change
Security to Medium go Tools|Macro|Security... then select Medium and
OK. After that you need to Close the document then reopen it. The
Security Warning dialog that then appears will need to have the "Enable
Macros" button clicked, otherwise the macro will not work.

Ken Johnson

Re: Placing an object at a specified layer
"Bob Buckland ?:-\)" <75214.226(At Beautiful Downtown)compuserve.com> 31.07.2006 14:26:28
Hi Keith,

Couldn't do too much with your Kingfisher (i.e. a picture rather than the Word .doc) itself, but, to add to Ken's reply, generally
when you're 'drawing' (working with autoshapes) as you insert it, it's the active drawing part so it's 'on top' to start. If you're
reusing basic shapes and have set a z-order for them (i.e. top, middle, bottom) that you're overlaying) you can store the lot of
them or individual ones as Autotext entries. When you insert a graphic from autotext it retains the properties it had when you
created the Autotext entry, but unfortunately that also includes the position of it on the page.

============
>>"Keith Howell" <KeithHowell[ at ]discussions.microsoft.com> wrote in message
news:65283FA3-D446-4944-B5D0-CFC469F4EAA4[ at ]microsoft.com...
I had a go at drawing a Kingfisher last night and found that when I wanted to
push a new shape into position in amongst existing ones, the only option I
had was to continually choose Draw/Order/Send Backward.

My suggestion is being able to "spot" and existing object and then choose to
feed the new object in behind it

(Kingfisher not qutie finished yet but at :
homepages.tesco.net/keithhowell/ArtGallery/Kingfisher.htm
) >>
--
Bob Buckland ?:-)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*


Re: Placing an object at a specified layer
"Ken Johnson" <KenCJohnson[ at ]gmail.com> 31.07.2006 20:30:32

Hi Keith,

one other option I forgot about was Ctrl + Y after you have done the
first SendBackwards, which repeats the action. Just keep repeating Crtl
+ Y until the Shape is at the desired ZOrderPosition.

Ken Johnson

Re: Placing an object at a specified layer
Keith Howell 01.08.2006 16:55:02
Thank you Ken & Bob for your replies. It's years since I used macros but I am
going to give it a go. If you have been followiing other threads you will
understand I am feeling a little bruised at the moment but the effort you
have put in to your replies is a tonic

"Ken Johnson" wrote:

[Quoted Text]
>
> Hi Keith,
>
> one other option I forgot about was Ctrl + Y after you have done the
> first SendBackwards, which repeats the action. Just keep repeating Crtl
> + Y until the Shape is at the desired ZOrderPosition.
>
> Ken Johnson
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net