HorizontalRuleFormat class

HorizontalRuleFormat class

Represents horizontal rule formatting. To learn more, visit the Working with Shapes documentation article.

Properties

NameDescription
alignmentGets or sets the alignment of the horizontal rule.
colorGets or sets the brush color that fills the horizontal rule.
heightGets or sets the height of the horizontal rule.
no_shadeIndicates the presence of 3D shading for the horizontal rule. If True, then the horizontal rule is without 3D shading and solid color is used.
width_percentGets or sets the length of the specified horizontal rule expressed as a percentage of the window width.

Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_horizontal_rule()

horizontal_rule_format = shape.horizontal_rule_format
horizontal_rule_format.alignment = aw.drawing.HorizontalRuleAlignment.CENTER
horizontal_rule_format.width_percent = 70
horizontal_rule_format.height = 3
horizontal_rule_format.color = drawing.Color.blue
horizontal_rule_format.no_shade = True

self.assertTrue(shape.is_horizontal_rule)
self.assertTrue(shape.horizontal_rule_format.no_shade)

See Also