HorizontalLineFormat Object

Microsoft Word Visual Basic

InlineShapeHorizontalLineFormat

Represents horizontal line formatting.

Using the HorizontalLineFormat Object

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

Selection.InlineShapes.AddHorizontalLineStandard
ActiveDocument.InlineShapes(1) _
    .HorizontalLineFormat.Alignment = _
    wdHorizontalLineAlignLeft
		

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

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.

Selection.InlineShapes.AddHorizontalLineStandard
ActiveDocument.InlineShapes(1) _
    .HorizontalLineFormat.PercentWidth = 50