Edit

InlineShapes.AddHorizontalLine method (Word)

Adds a horizontal line based on an image file to the current document.

Syntax

expression. AddHorizontalLine( _FileName_ , _Range_ )

expression Required. A variable that represents an 'InlineShapes' collection.

Parameters

Name Required/Optional Data type Description
FileName Required String The file name of the image you want to use for the horizontal line.
Range Optional Variant The range above which Microsoft Word places the horizontal line. If this argument is omitted, Word places the horizontal line above the current selection.

Remarks

To add a horizontal line that isn't based on an existing image file, use the AddHorizontalLineStandard method.

Example

This example adds a horizontal line above the current selection in the active document using a file called "ArtsyRule.gif."

Selection.InlineShapes.AddHorizontalLine _ 
 "C:\Art files\ArtsyRule.gif"

See also

InlineShapes Collection Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.