please some one help to workout like this. the circle and rectangle is of any shape

Parents
  • test it ...


    'select two objects and ...

    Sub Dup_and_Align()
    Dim shr As ShapeRange, rec As Shape, cir As Shape, x1 As Double, y1 As Double, wrec As Double, hrec As Double
    ActiveDocument.ReferencePoint = cdrCenter
    Set shr = ActiveSelectionRange
    If shr(1).SizeHeight < shr(2).SizeHeight Then
    Set cir = shr(1)
    Set rec = shr(2)
    Else
    Set cir = shr(2)
    Set rec = shr(1)
    End If
    rec.GetBoundingBox x1, y1, wrec, hrec
    cir.SetPosition x1, y1
    cir.Duplicate wrec / 2, 0
    cir.Duplicate wrec, 0
    cir.Duplicate 0, hrec / 2
    cir.Duplicate 0, hrec
    cir.Duplicate wrec / 2, hrec
    cir.Duplicate wrec, hrec
    cir.Duplicate wrec, hrec / 2
    End Sub


Reply Children
No Data