Shape Members (Visio)

Represents anything you can select in a drawing window: a basic shape, a group, a guide, or an object from another application embedded or linked in Microsoft Visio.

Methods

Name

Description

AddGuide

Adds a guide to a group shape.

AddHyperlink

Adds a Hyperlink object to a Microsoft Visio shape.

AddNamedRow

Adds a row that has the specified name to the specified ShapeSheet section.

AddRow

Adds a row to a ShapeSheet section at a specified position.

AddRows

Adds the specified number of rows to a ShapeSheet section at a specified position.

AddSection

Adds a new section to a ShapeSheet spreadsheet.

AddToContainers

Adds the shape to all underlying containers that allow it as a member.

AutoConnect

Automatically draws a connection in the specified direction between the shape and another shape on the drawing page.

BoundingBox

Returns a rectangle that tightly encloses a shape.

BreakLinkToData

Breaks the link between the shape and the data row to which it is linked in the specified data recordset.

BringForward

Brings the shape or selected shapes forward one position in the z-order.

BringToFront

Brings the shape or selected shapes to the front of the z-order.

CenterDrawing

Centers a page's, master's, or group's shapes with respect to the extent of the page, master, or group. .

ConnectedShapes

Returns an array that contains the identifiers (IDs) of the shapes that are connected to the shape.

ConvertToGroup

Converts a selection or an object from another application (a linked or embedded object) to a group.

Copy

Copies a shape to the Clipboard.

CreateSelection

Creates various types of Selection objects.

CreateSubProcess

Creates and returns a new sub-process page that is linked to the shape.

Cut

Deletes an object or selection and places it on the Clipboard.

Delete

Deletes an object or selection.

DeleteEx

Deletes the additional shapes that are associated with the shape, such as connectors and unselected container members, when the shape is deleted.

DeleteRow

Deletes a row from a section in a ShapeSheet spreadsheet.

DeleteSection

Deletes a ShapeSheet section.

Disconnect

Unglues the specified connector end points and offsets them the specified amount from the shapes to which they were joined.

DrawArcByThreePoints

Creates a shape whose path consists of an arc defined by the three points passed as parameters.

DrawBezier

Creates a shape whose path is defined by the supplied sequence of Bezier control points.

DrawCircularArc

Creates a new shape whose path consists of a circular arc defined by its center, radius, and start and end angles.

DrawLine

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

DrawNURBS

Creates a new shape whose path consists of a single NURBS (nonuniform rational B-spline) segment.

DrawOval

Adds an oval (ellipse) to the Shapes collection of a group shape.

DrawPolyline

Creates a shape whose path is a polyline along a given set of points.

DrawQuarterArc

Creates a new shape whose path consists of an elliptical arc defined by the two points and the flag passed in as arguments.

DrawRectangle

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

DrawSpline

Creates a new shape whose path follows a given sequence of points.

Drop

Creates one or more new Shape objects by dropping an object onto a receiving object such as a master, drawing page, shape, or group.

DropMany

Creates one or more new Shape objects in a group. It returns an array of the IDs of the Shape objects it produces.

DropManyU

Creates one or more new Shape objects on a page, in a master, or in a group. It returns an array of the IDs of the Shape objects it produces.

Duplicate

Duplicates an object.

Export

Exports an object from Microsoft Visio to a file format such as .bmp, .dib, .dwg, .dxf, .emf, .emz, .gif, .htm, .jpg, .png, .svg, .svgz, .tif, or .wmf.

FitCurve

Reduces the number of geometry segments in a shape or shapes by replacing them with similar spline, arc, and line segments that approximate the paths of the initial segments. Typically, this reduces the number of segments in the shape.

FlipHorizontal

Flips an object horizontally.

FlipVertical

Flips an object vertically.

GetCustomPropertiesLinkedToData

Gets the IDs of the shape-data-item (custom property) rows in the Shape Data section of the shape's ShapeSheet spreadsheet linked to the specified data recordset.

GetCustomPropertyLinkedColumn

Gets the name of the data column linked to the shape data (custom property) row in the shape's ShapeSheet spreadsheet specified by the custom property index.

GetFormulas

Returns the formulas of many cells.

GetFormulasU

Returns the formulas of many cells.

GetLinkedDataRecordsetIDs

Gets the IDs of all the data recordsets that contain data rows linked to the shape.

GetLinkedDataRow

Gets the ID of the data row in the specified data recordset linked to the shape.

GetResults

Gets the results or formulas of many cells.

GluedShapes

Returns an array that contains the identifiers of the shapes that are glued to a shape.

Group

Groups the objects that are selected in a selection, or it converts a shape into a group.

HasCategory

Returns True if the specified category is in the shape categories list.

HitTest

Determines if a given x,y position hits outside, inside, or on the boundary of a shape.

Import

Imports a file into the current document.

InsertFromFile

Adds a linked or embedded object to a page, master, or group.

InsertObject

Adds a new embedded object or ActiveX control to a page, master, or group.

IsCustomPropertyLinked

Returns whether the shape data (custom property) row in the Shape Data section of the shape's ShapeSheet spreadsheet is linked to a data row in the specified data recordset.

Layout

Lays out the shapes or reroutes the connectors (or both) for the page, master, group, or selection.

LinkToData

Links a shape to a data row in a data recordset.

MoveToSubprocess

Moves the shape to the specified page and drops a replacement shape on the source page, then links it to the target page. Returns the selection of moved shapes on the target page.

Offset

Offsets a shape a specified amount.

OpenDrawWindow

Opens a new drawing window that displays a group.

OpenSheetWindow

Opens a ShapeSheet window for a Shape object.

Paste

Pastes the contents of the Clipboard into an object.

PasteSpecial

Inserts the contents of the Clipboard, allowing you to control the format of the pasted information and (optionally) establish a link to the source file (for example, a Microsoft Word document).

RemoveFromContainers

Removes the shape from all lists and containers of which it is a member.

Resize

Resizes the shape by moving shape handles as specified.

ReverseEnds

Reverses an object by flipping it both horizontally and vertically.

Rotate90

Rotates an object 90 degrees counterclockwise.

SendBackward

Moves a shape or selected shapes back one position in the z-order.

SendToBack

Moves the shape or selected shapes to the back of the z-order.

SetBegin

Moves the begin point of a one-dimensional (1-D) shape to the coordinates represented by xPos and yPos.

SetCenter

Moves a shape so that its pin is positioned at the coordinates represented by xPos and yPos. .

SetEnd

Moves the endpoint of a one-dimensional (1-D) shape to the coordinates represented by xPos and yPos.

SetFormulas

Sets the formulas of one or more cells.

SetResults

Sets the results or formulas of one or more cells.

SwapEnds

Swaps the begin and endpoints of a one-dimensional (1-D) shape.

TransformXYFrom

Transforms a point expressed in the local coordinate system of one Shape object from an equivalent point expressed in the local coordinate system of another Shape object.

TransformXYTo

Transforms a point expressed in the local coordinate system of one Shape object to an equivalent point expressed in the local coordinate system of another Shape object.

Ungroup

Ungroups a group.

UpdateAlignmentBox

Updates the alignment box for a shape.

XYFromPage

Transforms a point expressed in the local coordinate system of its Page or Master object to an equivalent point expressed in the local coordinate system of the Shape object.

XYToPage

Transforms a point expressed in the local coordinate system of a Shape object to an equivalent point expressed in the local coordinate system of its Page or Master object.

Properties

Name

Description

Application

Returns the instance of Microsoft Visio that is associated with an object. Read-only.

AreaIU

Returns the area of a Shape object in internal units (square inches). Read-only.

CalloutsAssociated

Returns an array of Long values that represent the collection of identifiers for all of the callout shapes that are associated with the target shape by a callout relationship. Read-only.

CalloutTarget

Gets or sets the target shape that is associated with the callout shape by a callout relationship. Read/write.

CellExists

Determines whether a particular ShapeSheet cell exists in the scope of the search. Read-only.

CellExistsU

Determines whether a particular ShapeSheet cell exists in the scope of the search. Read-only.

Cells

Returns a Cell object that represents a ShapeSheet cell. Read-only.

CellsRowIndex

Returns the index of a row to which a cell belongs. Read-only.

CellsRowIndexU

Returns the index of a row to which a cell belongs. Read-only.

CellsSRC

Returns a Cell object that represents a ShapeSheet cell identified by section, row, and column indices. Read-only.

CellsSRCExists

Determines whether a ShapeSheet cell exists in the scope of a search. Read-only.

CellsU

Returns a Cell object that represents a ShapeSheet cell. Read-only.

Characters

Returns a Characters object that represents the text of a shape. Read-only.

CharCount

Returns the number of characters in an object. Read-only.

ClassID

Returns the class ID string of a shape that represents an ActiveX control or an embedded or linked OLE object. Read-only.

Connects

Returns a Connects collection for a shape, page, or master. Read-only.

ContainerProperties

Returns the ContainerProperties object associated with the shape. Read-only.

ContainingMaster

Returns the Master object that contains an object. Read-only.

ContainingMasterID

Returns the ID of the Master object that contains an object. Read-only.

ContainingPage

Returns the page that contains an object.

ContainingPageID

Returns the ID of the page that contains an object. Read-only.

ContainingShape

Returns the Shape object that contains an object or collection. Read-only.

Data1

Gets or sets the value of the Data1 field for a Shape object. Read/write.

Data2

Gets or sets the value of the Data2 field for a Shape object. Read/write.

Data3

Gets or sets the value of the Data3 field for a Shape object. Read/write.

DataGraphic

Gets or sets the data graphic master (Master of type visTypeDataGraphic) that is associated with the shape. Read/write.

DistanceFrom

Returns the distance from one shape to another, measured between the closest points on the two shapes. Both shapes must be on the same page or in the same master. Read-only.

DistanceFromPoint

Returns the distance from a shape to a point. Read-only.

Document

Gets the Document object that is associated with an object. Read-only.

EventList

Returns the EventList collection of an object or the EventList collection that contains an Event object. Read-only.

FillStyle

Returns or sets the fill style for an shape. Read/write.

FillStyleKeepFmt

Applies a fill style to an object while preserving local formatting. Read/write.

ForeignData

Returns metafile, bitmap, or OLE data for a shape that represents a foreign object. Read-only.

ForeignType

Returns the subtype of a Shape object that represents a foreign object. Read-only.

FromConnects

Returns a Connects collection of the shapes connected to a shape. Read-only.

GeometryCount

Returns the number of Geometry sections for a shape. Read-only.

Help

Gets or sets the Help string for a shape. Read/write.

Hyperlinks

Returns the Hyperlinks collection for a Shape object. Read-only.

ID

Gets the ID of an object. Read-only.

Index

Gets the ordinal position of a Shape object in the Shapes collection. Read-only.

IsCallout

Indicates whether the shape is a callout shape. Read-only.

IsDataGraphicCallout

Specifes whether a shape is a data graphic callout. Read-only.

IsOpenForTextEdit

Indicates whether a shape is currently open for interactive text editing. Read-only.

Language

Represents the language ID of the version of the Microsoft Visio instance represented by the parent object. Read/write.

Layer

Returns the layer to which a shape is assigned. Read-only.

LayerCount

Returns the number of layers to which a shape is assigned. Read-only.

LengthIU

Returns the length (perimeter) of the shape in internal units. Read-only.

LineStyle

Specifies the line style for an object. Read/write.

LineStyleKeepFmt

Applies a line style to an object while preserving local formatting. Read/write.

Master

Returns the master from which the Shape object was created. Read-only.

MasterShape

If this shape is part of a master instance, returns the shape in the master that this shape inherits from. Read-only.

MemberOfContainers

Returns an array of Long values that represent the identifiers of the container shapes that include the shape as a member. Read-only.

Name

Specifies the name of an object. Read-only.

NameID

Returns a unique name for a shape. Read-only.

NameU

Specifies the universal name of a Shape object. Read/write.

Object

Returns an IDispatch interface on the ActiveX control or embedded or linked OLE 2.0 object represented by a Shape object or an OLEObject object. Read-only.

ObjectIsInherited

Indicates if a shape represents an ActiveX or OLE object that is inherited from the shape's master. Read-only.

ObjectType

Returns an object's type. Read-only.

OneD

Determines whether an object behaves as a one-dimensional (1-D) object. Read-only.

Parent

Determines the parent of a Shape object. Read/write.

Paths

Returns a Paths collection that reports the coordinates of a shape's paths in the coordinate system of the shape's parent. Read-only.

PathsLocal

Returns a Paths collection that reports the coordinates of a shape's paths in the shape's local coordinate system. Read-only.

PersistsEvents

Indicates whether an object is capable of containing persistent events in its EventList collection. Read-only.

Picture

Returns a picture that represents an enhanced metafile (EMF) contained in a master, shape, selection, or page. Read-only.

ProgID

Returns the programmatic identifier of a shape that represents an ActiveX control, an embedded object, or linked object. Read-only.

RootShape

Returns the top-level shape of an instance if this shape is part of a master instance. Read-only.

RowCount

Returns the number of rows in a ShapeSheet section. Read-only.

RowExists

Determines whether a ShapeSheet row exists. Read-only.

RowsCellCount

Returns the number of cells in a row of a ShapeSheet section. Read-only.

RowType

Runs the add-on represented by an Addon object.

Section

Returns the requested Section object belonging to a shape. Read-only.

SectionExists

Determines whether a ShapeSheet section exists for a particular shape. Read-only.

Shapes

Returns the Shapes collection for a page, master, or group. Read-only.

SpatialNeighbors

Returns a Selection object that represents the shapes that meet certain criteria in relation to a specified shape. Read-only.

SpatialRelation

Returns an integer that represents the spatial relationship of one shape to another shape. Both shapes must be on the same page or in the same master. Read-only.

SpatialSearch

Returns a Selection object whose shapes meet certain criteria in relation to a point that is expressed in the coordinate space of a page, master, or group. Read-only.

Stat

Returns status information for an object. Read-only.

Style

Gets or sets the style for a Shape object. Read/write.

StyleKeepFmt

Applies a style to an object while preserving local formatting. Read/write.

Text

Returns all of the shape's text. Read/write.

TextStyle

Gets or sets the text style for an object. Read/write.

TextStyleKeepFmt

Applies a text style to an object while preserving local formatting. Read/write.

Type

Returns the type of the object. Read-only.

UniqueID

Gets, deletes, or makes the GUID that uniquely identifies the shape within the scope of the application. Read-only.

Events

Name

Description

BeforeSelectionDelete

Occurs before selected objects are deleted.

BeforeShapeDelete

Occurs before a shape is deleted.

BeforeShapeTextEdit

Occurs before a shape is opened for text editing in the user interface.

CellChanged

Occurs after the value changes in a cell in a document.

ConvertToGroupCanceled

Occurs after an event handler has returned True (cancel) to a QueryCancelConvertToGroup event.

FormulaChanged

Occurs after a formula changes in a cell in the object that receives the event.

GroupCanceled

Occurs after an event handler has returned True (cancel) to a QueryCancelGroup event.

QueryCancelConvertToGroup

Occurs before the application converts a selection of shapes to a group in response to a user action in the interface. If any event handler returns True, the operation is canceled.

QueryCancelGroup

Occurs before the application groups a selection of shapes in response to a user action in the interface. If any event handler returns True, the operation is canceled.

QueryCancelSelectionDelete

Occurs before the application deletes a selection of shapes in response to a user action in the interface. If any event handler returns True, the operation is canceled.

QueryCancelUngroup

Occurs before the application ungroups a selection of shapes in response to a user action in the interface. If any event handler returns True, the operation is canceled.

SelectionAdded

Occurs after one or more shapes are added to a document.

SelectionDeleteCanceled

Occurs after an event handler has returned True (cancel) to a QueryCancelSelectionDelete event.

ShapeAdded

Occurs after one or more shapes are added to a document.

ShapeChanged

Occurs after a property of a shape that is not stored in a cell is changed in a document.

ShapeDataGraphicChanged

Occurs after a data graphic is applied to or deleted from a shape.

ShapeExitedTextEdit

Occurs after a shape is no longer open for interactive text editing.

ShapeLinkAdded

Occurs after a shape is linked to a data row.

ShapeLinkDeleted

Occurs after the link between a shape and a data row is deleted.

ShapeParentChanged

Occurs after shapes are grouped or a group is ungrouped.

TextChanged

Occurs after the text of a shape is changed in a document.

UngroupCanceled

Occurs after an event handler has returned True (cancel) to a QueryCancelUngroup event.