any easy fast possible way to group all these business cards separately. https://we.tl/tylZcTY3p6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Sub group_on_selected_rectangles() Dim srRectangles As ShapeRange Dim sRect As Shape On Error GoTo ErrHandler ActiveDocument.BeginCommandGroup "Group objects on selected rectangles" EventsEnabled = False Optimization = True Set srRectangles = ActiveSelectionRange For Each sRect In srRectangles ActivePage.SelectShapesFromRectangle sRect.LeftX, sRect.BottomY, sRect.RightX, sRect.TopY, False ActiveSelectionRange.Group Next sRect ExitSub: Optimization = False EventsEnabled = True ActiveDocument.EndCommandGroup Refresh Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub
Eskimo,
I hope you do not mind, I have changed your code a little bit. I added some CQL to find all other shapes the same size as the original one selected.
Happy Coding,
-Shelby
Sub group_on_selected_rectangles() Dim srSelection As ShapeRange, srRectangles As ShapeRange Dim sRect As Shape Set srSelection = ActiveSelectionRange If srSelection.Shapes.Count > 1 Then MsgBox "Please only select one shape.": Exit Sub On Error GoTo ErrHandler ActiveDocument.BeginCommandGroup "Group objects on selected rectangles" EventsEnabled = False Optimization = True Set srRectangles = ActivePage.Shapes.FindShapes(Query:="@width = {" & srSelection(1).SizeWidth & " in } and @height ={" & srSelection(1).SizeHeight & " in }") For Each sRect In srRectangles ActivePage.SelectShapesFromRectangle sRect.LeftX, sRect.BottomY, sRect.RightX, sRect.TopY, False ActiveSelectionRange.Group Next sRect ExitSub: ActiveDocument.ClearSelection Optimization = False EventsEnabled = True ActiveDocument.EndCommandGroup Refresh Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub
No offense taken, Shelby!
I considered doing that, but came down on the side of "expose them to the benefits of Select Same" instead.
Seeing both ways? Even better.
1 more issue with this design please help in that too
if i change size of business card of entire last row below shown issue comes up why?
this issue comes in top rows as well but not on every card thats why i mentioned only last row
What size are you trying to make each business card?
These all have PowerClips. Some of them use rectangles. Some of them use Curves that look like rectangles, and there is something weird about them - they go crazy if I try to resize them.
My guess is that the design was created in Illustrator or something similar. I routinely run into issues with Corel attempting to import an .AI or .EPS file and having those crazy issues. Perhaps copying them to a brand new document? Sometimes the file I have been working on, when it gets complex, it acts strangely as well.
How to"change size of business card of entire last row "? All the logic of the above presented code selects and groups only the shapes INSIDE THE SAME DIMENSIONS SHAPE as the initially selected one.
Besides that I can not understand what really happens... Can you post a link to that specific file behaving in that way? Maybe after testing it I will understand what do you mean and maybe why that behavior.