Change ZOrder of grouped shapes (Word 2011 for Mac) RRS feed

  • Question

  • In the MS VB documentation I found an example how to group some shapes. The example looks almost like this:
    Sub T1()
        Dim T1  As Shape
        Dim T2  As Shape
        With ActiveDocument.Shapes
            Set T1 = .AddTextbox(msoTextOrientationHorizontal, 50, 50, 200, 100)
            With T1
                .Name = "BoxOne"
                .TextFrame.TextRange.Text = "This is the first text box."
            End With
            Set T2 = .AddTextbox(msoTextOrientationHorizontal, 100, 100, 200, 100)
            With T2
                .Name = "BoxTwo"
                .TextFrame.TextRange.Text = "This is the second text box."
            End With
            With .Range(Array("BoxOne", "BoxTwo")).Group
            End With
        End With
    End Sub
    The "Group" instruction does not work. I always get a runtime error 9 that says that no element with the mentioned name can be found.
    Does anybody have an idea what's going wrong here?
    Tuesday, April 16, 2013 2:42 PM