Microsoft Word: How to move overlapping frames to fore- or background

Hi Word Experts,

I have a Word 2003 document (I have tried the following in both Word 2003 and 2010) that contains two frames (to bundle and arrange text blocks). One frame is smaller and fully behind the other frame. When I now want to click on the smaller frame to edit the text, I always select the larger frame that sits on top of the smaller one.

How can I arrange the two frames so that the smaller one comes to the foreground?

Before you post a comment please note that I'm not talking about textboxes or graphic boxes that can be sent behind other objects. I'm talking about text frames. (see Microsoft's definition of frame)

Thank you and best regards,

Who is Participating?
GrahamSkanConnect With a Mentor RetiredCommented:
I don't think that there is any easy way of doing that, even in VBA code.

There is no programmatic method that I can find for discovering or setting the zOrder. Nor is it possible to make the background transparent. There is a method to convert a Textbox to a Frame, but not the other way round, probably because the Frame methods were designed before the Textbox was designed.

I have explored the possibility programmatically deleting the frames and re-adding them in a particular order, assuming that the last added would cover the first, but that is more complicated than I expected

As you might know, Microsoft have been reducing the support for frames. There is no mention in the 2007 ribbon. Can you consider using textboxes instead?
StaudteAuthor Commented:
Hi Graham,

thanks for having a look at that problem. I was afraid that there is not way to change the zorder of frames. Why in one document they are stacked in one way in in a nother document they are stack the oher way will most likely remain a mystery...

And, yes, I can switch to textboxes - it's an aweful work (roughly two dozen documents need to be changed), but what helps...

If you do intend to switch to textboxes, you might like to try this macro. It isn't perfect, but I don't know how precise you need the positions to be.
Sub ConvertToTextBoxes()
    Dim fr As Frame
    Dim rng As Range
    Dim brd As Border
    Dim sh As Shape
    Dim f As Integer
    Dim l As Single, t As Single, h As Single, w As Single
    Do While ActiveDocument.Frames.Count > 0
        With ActiveDocument.Frames(1)
            l = .HorizontalPosition
            t = .VerticalPosition
            h = .Height
            w = .Width
            Set rng = .Range
            Set sh = ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, l, t, w, h, rng)
            For Each brd In rng.Paragraphs.First.Borders
                brd.LineStyle = wdLineStyleNone
            Next brd
        End With

End Sub

Open in new window

StaudteAuthor Commented:
Hi Graham,

thanks a lot for this cool macro - it'll save me quite a bit of work. If anyone ever reads this again: The macro has a problem in line 18 when width or heigt of the frame were set to automatic (h or w = -1), which will fail when the textbox is created. Also, the positioning of the textboxes does not maintain the fixpoint, i.e. if the frame was relative to page, margin, etc. Also, borders are set for the textboxes, while the frames had no borders.

Graham, you don't need to fix this for me - it helps me the way it is, because it does convert the relevant frames and shifting them to the right position on the page is done by a flick of the mouse. I'm noting this only as a hint for anyone who might read this in the future.

Thanks again!
Hi Thomas,

Thanks for the information. I'm glad that you find it useful. Perhaps I'll improve it if another question is posted sometime in the future.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.