Hello to all,
i´ve grouped some shapes to a shaperange and
some other shapes to another shaperange using VBA
How to group these two ShapeRages?
Thanks a lot
DC
Thanks for the Help!
But it is not succesful
My Shapes Ranges both contains different Type of Shapes, mainly Lines and Circles and Text. So, i need something like
Dim sr1, sr2, sr_complete as ShapeRange
...
sr_Complete = sr1 + sr2
dim sr_Complete as New ShapeRange
sr_Complete.AddRange sr1
sr_Complete.AddRange sr2
I´m sorry. I just wanted not the whole Code for better viewing but i forgot a for .. next...
So:
Group1
is a Curve and a numer of ellipses and a number of Rectangles
Group2
is a number of ArtisticTextShapes and probably a number of other Ellipses
And there are more other type of Shapes and ShapeRanges in the page that must not be included
Thanks for your patience again ;-)DC
Do you need to have any "groups that contain groups"?
Here is an example that:
Sub groups_example_1() Dim srEllipses As New ShapeRange Dim sEllipseThis As Shape Dim sEllipsesGrouped As Shape Dim srRectangles As New ShapeRange Dim sRectangleThis As Shape Dim sRectangelsGrouped As Shape Dim srBothGroups As New ShapeRange Dim sBothGroups As Shape Dim i As Long For i = 1 To 10 Set sEllipseThis = ActiveLayer.CreateEllipse2(0, 0, i) srEllipses.Add sEllipseThis Next i Set sEllipsesGrouped = srEllipses.Group For i = 1 To 10 Set sRectangleThis = ActiveLayer.CreateRectangle2(0, 0, i * 2, i) srRectangles.Add sRectangleThis Next i Set sRectangelsGrouped = srRectangles.Group srBothGroups.Add sEllipsesGrouped srBothGroups.Add sRectangelsGrouped Set sBothGroups = srBothGroups.Group End Sub
As usualy it is that simply...
But i never would have found out!
Thanks very much !
Mille Grazie
and thanks for your patience!
One last Question please for this:
how to select the sBothGroups, so that when the makro is finished you can grap all..?
sBothGroups.CreateSelection