How do I move objects from all layers into selection?

I can select all objects in current layer with the following

                 ActiveLayer.Shapes.All.AddToSelection

but,  how do I loop through all layers and add their shapes to Selection?

Parents
  • Depending on the content you are trying to access, you might use ActivePage.Shapes.FindShapes().

    FindShapes can be recursive (dig into groups) or non-recursive, and you can use a CQL query to exclude specific content (e.g., guidelines, shapes on specific layers, shapes on locked layers, etc.).

    So something such as this:

    Sub select_stuff()
    Dim sr As ShapeRange
    
        Set sr = ActivePage.Shapes.FindShapes(, , False, "@type != 'guide' and @com.layer.isguideslayer = 'False' and @com.layer.isdesktoplayer = 'False'")
        sr.CreateSelection
    End Sub
    
Reply Children
No Data