Is it possible to display object name values from desktop layer (not from the active page) ?
I am already using macro for renaming objects and moving them from all pages to desktop area.
Also using a macro to find the objects with particular value. But now I need a macro to display the object name values of each renamed objects. (All renamed object values are integer)
Can anyone help with this ?
Values are showing in Immediate window in VBA (Ctrl+G)
How to list these values to a listbox in form ?
Do you really need a listbox as a user form?The modified macro creates a paragraphic text in the middle of all shapes that are not on the page. If you distribute the shapes to the left and right of the page, then the text can end up on the page.
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
Sub NamesFromDesktopArea() Dim s As Shape, SR As ShapeRange, p As Page Dim Name As String Dim names As String Dim posX As Double, posY As Double, posHei As Double, posWid As Double Set p = ActivePage Set SR = ActiveDocument.ActivePage.SelectShapesFromRectangle(p.LeftX, p.TopY, p.RightX, p.BottomY, True).Shapes.All ActivePage.Shapes.All.CreateSelection SR.RemoveFromSelection Set SR = ActiveSelectionRange For Each s In SR Name = s.Name 'Debug.Print s.Name 'off names = names & s.Name & vbCrLf & vbCrLf ' One Line Space Next s ' Create a text shape Dim textShape As Shape Set textShape = ActiveLayer.CreateArtisticText(0, 0, names, cdrMixedAlignment) textShape.Fill.UniformColor.RGBAssign 255, 0, 0 SR.GetBoundingBox posX, posY, posWid, posHei textShape.AlignToPoint cdrAlignHCenter, posX + posWid / 2, posY + posHei / 2, cdrTextAlignBoundingBox textShape.AlignToPoint cdrAlignVCenter, posX + posWid / 2, posY + posHei / 2, cdrTextAlignBoundingBox End Sub
Thanks for reply.
My scenario is , I have multiple barcode labels for printing. Usually with smaller sizes and mixed quantities. So I sort out the similar quantities and place them into a larger sheets for printing. Like A3 or A2 size paper. Each labels are created in a single page. Currently I am grouping each pages and rename it to the required quantity. After that move them into the desktop area. Then open object manager docker and look for the quantities. Finally select these items and place them into the page. I have macro for grouping, renaming and moving processes. But the problem is when looking for the quantities, all the quantities including the current page is displaying in docker. So I am looking for an alternative option to display only name of objects in desktop area.
As what (e.g. single text above the shapes, displaytext) should the names be displayed?