DrawRectangle method

Microsoft Visio Developer Reference

DrawRectangle method

       

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

Version added

2.0

Syntax

objRet = object.DrawRectangle (x1, y1, x2, y2)

objRet

A Shape object that represents the new rectangle.

object

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

x1

Required Double. The left side of the rectangle's width-height box.

y1

Required Double. The top of the rectangle's width-height box.

x2

Required Double. The right side of the rectangle's width-height box.

y2

Required Double. The bottom of the rectangle's width-height box.

Remarks

Using the DrawRectangle method is equivalent to using the Rectangle tool in the application. The arguments are in internal drawing units with respect to the coordinate space of the page, master, or group where the rectangle is being placed.