首页/ 接口索引/ Text 文本对象

shape.Text.Story

文本故事对象,所有排版属性的真正载体。

签名

shape.Text.Story

说明

文本故事对象,所有排版属性的真正载体。

Python 示例(可直接运行)

依赖 pywin32。示例假定 app / doc / page / layer 已就绪。 见「连接与初始化」
Python
shape = app.ActiveSelectionRange(1)

story = shape.Text.Story           # Story : 文本排版属性的真正载体
print("字符数:", story.Characters.Count)
print("行数:", story.Lines.Count)
print("段落数:", story.Paragraphs.Count)

关于本类:Text 文本对象

文字接口分两层:Shape.Text 是入口,真正读写字体字号要下到 Story.Characters.All。

同类其他接口