Shapes.AddLine method (Publisher)

Adds a new Shape object representing a line to the specified Shapes collection.

Syntax

expression.AddLine (BeginX, BeginY, EndX, EndY)

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data type Description
BeginX Required Variant The x-coordinate of the beginning point of the line.
BeginY Required Variant The y-coordinate of the beginning point of the line.
EndX Required Variant The x-coordinate of the ending point of the line.
EndY Required Variant The y-coordinate of the ending point of the line.

Return value

Shape

Remarks

For the BeginX, BeginY, EndX, and EndY arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

Example

The following example adds a new line to the first page of the active publication.

Dim shpLine As Shape 
 
Set shpLine = ActiveDocument.Pages(1).Shapes.AddLine _ 
 (BeginX:=144, BeginY:=144, _ 
 EndX:=180, EndY:=72) 

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.