Search in Powerclip

Dim s As Shape

ActiveLayer.Shapes.All.CreateSelection
For Each s In ActiveSelection.Shapes.FindShapes
If s.Type = cdrMeshFillShape Then
Set s1 = s.ConvertToBitmapEx(cdrCMYKColorImage, False, True, 200, cdrNormalAntiAliasing, True, False, 95)
End If
Next

This macro search all meshes and make it bitmap, but not in powerclips, so how to do this with powerclip in document?

Parents
No Data
Reply
  • Dim SR As ShapeRange, SM As ShapeRange, GN As New ShapeRange, s As Shape, g As Shape, b As Shape
    ActiveDocument.BeginCommandGroup

    For Each s In ActivePage.Shapes.FindShapes(Type:=cdrGroupShape)
    Set SM = s.UngroupEx
    SM.UngroupAll

    For Each g In ActiveSelection.Shapes.FindShapes(Query:="!@com.powerclip.IsNull")
    Set SR = g.PowerClip.ExtractShapes
    SR.UngroupAll
    For Each b In ActiveSelection.Shapes
    If Not b.Transparency.Type = cdrNoTransparency Then
    Set AM = b.ConvertToBitmapEx(cdrCMYKColorImage, False, True, 200, cdrNormalAntiAliasing, True, False, 95)
    Else
    Set AM = b
    End If
    GN.Add AM
    Next
    GN.AddToPowerClip g, cdrFalse

    Next

    SM.Group
    Next

    ActiveDocument.EndCommandGroup
    End Sub

    I just don't know what to do next, it work only with one group, next group produce error.

    if i use only "Set SM = s.UngroupEx" then it works fine BUT only when group not contain other groups. If i use "Set SM = s.UngroupEx" with "SM.UngroupAll" then script get error after first group. And i cant; make something like "Set SM = s.UngroupAll" cause this make error to :(

    i found that "ActivePage.Shapes.FindShapes(Type:=cdrGroupShape)" get all groups, even groups in groups, so when i do ungroupall, all subsequence get broken. How to find only main groups?

Children
No Data