Table of contents
Collapse the table of content
Expand the table of content

Shape.DrawLine Method (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Adds a line to the Shapes collection of a group shape.


expression . DrawLine( xBegin , yBegin , xEnd , yEnd )

expression A variable that represents a Shape object.


NameRequired/OptionalData TypeDescription
xBeginRequiredDoubleThe x-coordinate of the line's begin point.
yBeginRequiredDoubleThe y-coordinate of the line's begin point.
xEndRequiredDoubleThe x-coordinate of the line's endpoint.
yEndRequiredDoubleThe y-coordinate of the line's endpoint.

Return Value



Using the DrawLine method is equivalent to using the Line tool in Microsoft 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.


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
© 2018 Microsoft