Share via


DrawLine Method [Visio 2003 SDK Documentation]

Adds a line to the Shapes collection of a page, master, or group.

objRet = object**.DrawLine** (xBegin, yBegin, xEnd, yEnd)

objRet     A Shape object that represents the new line.

object     Required. An expression that returns a Page, Master, or Shape object on which to draw the line.

xBegin     Required Double. The x-coordinate of the line's begin point.

yBegin     Required Double. The y-coordinate of the line's begin point.

xEnd     Required Double. The x-coordinate of the line's end point.

yEnd     Required Double. The y-coordinate of the line's end point.

Version added

2.0

Remarks

Using the DrawLine method is equivalent to using the Line tool in Microsoft Office Visio. The arguments are in internal drawing units with respect to the coordinate space of the page, master, or group where the line is being placed.

Example

The following example shows how to draw a line shape on the active page.

Public Sub DrawLine_Example()
 
    Dim vsoShape As Visio.Shape 

    Set vsoShape = ActivePage.DrawLine(5, 4, 7.5, 1) 

End Sub  

    

Applies to | Master object | Page object | Shape object