Home/ Reference/ PowerClip

shape.PowerClip.Shapes

Shapes inside the container. From here FindShapes can reach text — that's the one line that finds text through a container.

Signature

shape.PowerClip.Shapes

Notes

Shapes inside the container. From here FindShapes can reach text — that's the one line that finds text through a container.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
page = doc.ActivePage

# find every frame on the page and read the text inside
for i in range(1, page.Shapes.Count + 1):
    s = page.Shapes.Item(i)
    try:
        pc = s.PowerClip
    except Exception:
        pc = None

    if pc is None:
        continue

    inner_texts = pc.Shapes.FindShapes("", 6, True)   # text inside the container
    print("container", i, "holds", pc.Shapes.Count, " object(s), text: ", inner_texts.Count, " item(s)")

    for k in range(1, inner_texts.Count + 1):
        print("    text: ", inner_texts.Item(k).Text.Contents)

About this section: PowerClip

PowerClip — clipping content into a frame.

Other entries in this section