Home/ Reference/ Text

shape.Text.Range(start, end)

Returns a character range, for local typography like recoloring the first few characters.

Signature

shape.Text.Range(start, end)

Notes

Returns a character range, for local typography like recoloring the first few characters.

Python example (runnable)

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

# Range(start, end): style part of a run (1-based)
first3 = shape.Text.Range(1, 3)
print("First three characters: ", first3.Text)

first3.Size = 48                       # enlarge just these characters
first3.Fill.UniformColor.RGBAssign(255, 0, 0)   # colour just these characters red
print("First three characters enlarged and coloured red")

About this section: Text

Text — artistic and paragraph text.

Other entries in this section