Skip to content
本页内容

Alignment (属性)

返回或设置一个 MsoTextEffectAlignment 值,它代表艺术字的对齐方式。

示例

python
#此示例向第一张工作表中添加艺术字对象,然后将该对象设置右对齐
def test():
    shapes = Application.Worksheets.Item(1).Shapes
    shape = shapes.AddTextEffect(msoTextEffect1, "Test Text", "Palatino", 54, True, False, 100, 50)
    shape.TextEffect.Alignment = msoTextEffectAlignmentRight
python
#此示例显示活动工作表的第一个艺术字的对齐方式是否为居中对齐
def test():
    shape = ActiveSheet.Shapes.Item(1)
    print(shape.TextEffect.Alignment == msoTextEffectAlignmentCentered)