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
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
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.
https://we.tl/tylZcTY3p6
I tested the file and everything runs smooth... Corel X8 64 bit.
Al the shapes in the wished rectangle area are well grouped. Any not grouped shape remained. I cannot reproduce your problem. Are you sure that you sent that file? You mentioned something about "if i change size of business card of entire last row". What did you mean? The shapes in the last row have the same dimensions like the rest of them...
Looking to your sample picture shell I understand that the last some shapes disappear and instead of them you have that long triangle?
i am using x6 64bit
if i change size of business card of last row mean
i am changing size of all business card 1 by 1 of last row.
yes it become like a triangle or something like that sometime triangle in bottom direction just like in the picture and sometime triangle become in upper direction.