Share via


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)