AddLine Method

Microsoft Publisher Visual Basic

object representing a line to the specified Shapes collection.

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

expression    Required. An expression that returns one of the objects in the Applies To list.

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.

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)