Home/ Reference/ Text

shape.Text.Story.Characters

Character collection. .Count gives the character count, .Item(i) a single character.

Signature

shape.Text.Story.Characters

Notes

Character collection. .Count gives the character count, .Item(i) a single character.

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
shape = app.ActiveSelectionRange(1)
chars = shape.Text.Story.Characters

print("Total characters: ", chars.Count)

# read it character by character (element 1 is the first)
for i in range(1, min(chars.Count + 1, 6)):
    print(i, repr(chars.Item(i).Text))

About this section: Text

Text — artistic and paragraph text.

Other entries in this section