首页/ 接口索引/ 描边

shape.Outline.Width

线宽,单位跟 doc.Unit。设 0 就等于去掉描边,比改 Type 省事。代码里满页背景矩形就是这么「无描边」的。

签名

shape.Outline.Width

说明

线宽,单位跟 doc.Unit。设 0 就等于去掉描边,比改 Type 省事。代码里满页背景矩形就是这么「无描边」的。

Python 示例(可直接运行)

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

print("线宽:", o.Width)           # 单位同文档单位(本机是英寸)

o.Width = 2 / 25.4                 # 设成 2mm
print("改后线宽:", o.Width)

o.Width = 0                        # 设 0 就等于去掉描边,比改 Type 省事

关于本类:描边

宽度单位跟 doc.Unit(英寸),颜色与端点样式单独设。

同类其他接口