Thread: shaperange.add
View Single Post
  #9  
Old 29-06-2011, 23:02
HeauxmBru
Guest
 
Posts: n/a
Default

Hey guys,

I finally got it to work.

Here's what I did.

Code:
   
 lName = ActivePage.ActiveLayer.Name
    Set lr = ActivePage.CreateLayer("MyLayer")
    lr.Activate
    s1.MoveToLayer lr

    s1.SetPosition sx, -sy
    sr.Add s1
    
    For i = 1 To RowNum - 1
        s1.Duplicate w + xGutter, 0
        w = w + w1 + xGutter
    Next i

    Set sr = ActivePage.ActiveLayer.Shapes.All
    sr.Group.CreateSelection
    
    sr.GetBoundingBox x, y, w, h
    w1 = w
    h1 = h
    
    For i = 1 To ColNum - 1
        s1.Duplicate 0, -h + -yGutter
        h = h + h1 + yGutter
    Next i

    Set sr = ActivePage.ActiveLayer.Shapes.All
    sr.Group.CreateSelection
    sr.Copy
    
    Set lr = ActivePage.Layers.Find(lName)
    lr.Activate
    lr.Paste
    
    ActiveSelection.Ungroup
    d.ClearSelection
    
    ActivePage.Layers.Find("MyLayer").Delete
I still don't understand why sr.add didn't work. Seems like it should've.
Reply With Quote