HorizontalLineFormat Object

Word Developer Reference

Represents horizontal line formatting.

Remarks

Use the HorizontalLineFormat property to return a HorizontalLineFormat object. This example sets the alignment for a new horizontal line.

Visual Basic for Applications
  Selection.InlineShapes.AddHorizontalLineStandard
ActiveDocument.InlineShapes(1) _
    .HorizontalLineFormat.Alignment = _
    wdHorizontalLineAlignLeft

This example adds a horizontal line without any 3-D shading.

Visual Basic for Applications
  Selection.InlineShapes.AddHorizontalLineStandard
ActiveDocument.InlineShapes(1) _
    .HorizontalLineFormat.NoShade = True

This example adds a horizontal line and sets its length to 50% of the window width.

Visual Basic for Applications
  Selection.InlineShapes.AddHorizontalLineStandard
ActiveDocument.InlineShapes(1) _
    .HorizontalLineFormat.PercentWidth = 50

See Also