left is page view and right side is objects manager
shall we bring the images in objects manager to page view
For a single column
Sub SortAndSetPositions()
Dim sr As ShapeRange Set sr = ActiveSelectionRange
sr.Sort "@shape1.com.positiony > @shape2.com.positiony"
Dim positionsX() As Double Dim positionsY() As Double ReDim positionsX(1 To sr.Count) ReDim positionsY(1 To sr.Count)
Dim i As Integer For i = 1 To sr.Count positionsX(i) = sr(i).PositionX positionsY(i) = sr(i).PositionY Next i
sr.Sort "@shape1.com.zorder < @shape2.com.zorder"
ActiveDocument.BeginCommandGroup For i = 1 To sr.Count sr(i).SetPosition positionsX(i), positionsY(i) Next i
ActiveDocument.EndCommandGroupEnd Sub
objects in page view are shifting by y direction. but it should not be happened. objects in page view objects maintain the same placement without shifting, but the order should be stacked from top to bottom. similarly the look that is appearing in the page view, the same must be shown in objects manager also sir
isn't this?
I have something that organizes an entire grid but the chatgpt couldn't convert to VBA
sir just imagine we have 6 objects in page view. the view that are existed are correct to our eyes, but while observe the same in objects manager the 6 objects may not in order.
here left is page and right is object manager.
i want the top object is top and extreme bottom object is bottom. in between objects are beneath the top object .... likewise it has to come down to extreme bottom. for this objects (by maintaining its same placement) is stacked using the command behind. hope you understood my english language. not good in english. but hoping so
your code is working, but objects are shifting and maintaining the order. my request is that it should not be shifted but only has to ordered. the top object is top only and the bottom object is bottom only. in between objects are stacked (here also the inbetween objects are used the command behind.. thus way it is stacked and it should not moved)
https://drive.google.com/file/d/1YktDQxuKxNMwJvqMcjzYJjPXxJsYZ0ze/view?usp=sharing
See this for better comprehension
Sub ReorderZOrderByShapePositionY() Dim sr As ShapeRange Set sr = ActiveSelectionRange sr.Sort "@shape1.com.positiony > @shape2.com.positiony"
Dim au As ShapeRange Set au = CreateShapeRange au.Add sr(1)
Dim i As Integer For i = 2 To sr.Count au.OrderFrontOf sr(i) au.Add sr(i) Next i
End Sub
wow. great sir. love you so much. thanking you.