convert image into powerclip

Im looking for any Macro which can convert image into powerclip. If i select an image it should create a vector boundary around the image and insert inside the shape (powerclip). Anyway or help to create the Macro. I tried to record the macro but it did not work. Thanks

  • try this

    Sub ImageAsPowerclip()
    Dim sr As ShapeRange, s As Shape, x#, y#, w#, h#
    Dim nsr As ShapeRange
    ActiveDocument.BeginCommandGroup "ImageAsPowerclip"
    Optimization = True
    Set sr = ActiveSelectionRange
    If sr.Count = 0 Then Exit Sub
    ActiveDocument.Unit = cdrMillimeter
    For Each s In sr
    s.GetBoundingBox x, y, w, h
    s.CreateBoundary x, y, True



    Set nsr = ActiveSelectionRange

    nsr.Shapes(1).AddToPowerClip nsr.Shapes(2), cdrTrue

    Next s
    Optimization = False

    End Sub