VBA学习笔记(9)-Shape Object Members

Shape Object Members

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 Office Visio.

Methods


 


Name


Description

 
AddGuide


Adds a guide to a group shape.

 
AddHyperlink


Adds a Hyperlink object to a Microsoft Office 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.

 
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.

 
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.

 
Cut


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

 
Delete


Deletes an object or selection.

 
DeleteRow


Deletes a row from a section in a ShapeSheet spreadsheet.

 
DeleteSection


Deletes a ShapeSheet section.

 
DrawArcByThreePoints


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

 
DrawBezier


Creates a new 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 new 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 Office 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.

 
Group


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

 
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 and/or reroutes the connectors for the page, master, group, or selection.

 
LinkToData


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

 
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).

 
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 end point 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 end points 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


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

 
AreaIU


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

 
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.

 
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 Data2 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. 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 object. 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.

 
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 Office 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.

 
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


Gets or sets the type of a row in a Geometry, Connection Points, Controls, or Tabs ShapeSheet section. Read/write.

 
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.

时间: 2024-10-13 22:28:11

VBA学习笔记(9)-Shape Object Members的相关文章

VBA学习笔记之VBA学习思路

进阶的知识点 1. SQL查询语句和ADO2. 正则表达式和网抓3. 窗体与控件4. API 类模块 等等 作者:SOROSay链接:https://www.zhihu.com/question/26078625/answer/132542043来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 1小时 熟悉数据类型.变量.常量和运算符 1.了解VBA有哪些数据类型 2.知道如何定义变量,了解public/dim/private定义变量时的区别 3.知道如何定义常量

VBA学习笔记(8)-Application Object Members

Application Object Members Represents an instance of Microsoft Office Visio. An external program typically creates or retrieves an Application object before it can retrieve other Visio objects from that instance. Use the Microsoft Visual Basic Create

VBA学习笔记(10)-Cell Object Members

Cell Object Members Holds a formula that evaluates to some value. Methods   Name Description   GlueTo Glues one shape to another, from a cell in the first shape to a cell in the second shape.   GlueToPos Glues one shape to another from a cell in the

VBA学习笔记(7)-经典例子

例:VBA获取shape position Public Sub LocationTable() 'This routine will create a text file of the location and size of all 2-d shapes ' on the current page Dim shpObj As Visio.Shape, celObj As Visio.Cell Dim ShpNo As Integer, Tabchr As String, localCent

VBA学习笔记(3)-理解Visio Shapesheet

其实Visio中的每个shape(包括你画的图形,线条等等),后台都有一个表来记录所有的属性,这个表我们叫做ShapeSheet. VBA编程中,你可能需要获取shape属性,其实也可以在这里参考: Open a Visio diagram containing a shape that you want to work with in Microsoft Visio 2007. Click on the shape you want to customize to select it. Fro

VBA学习笔记之随机数&数组redim

发现更简单的: a=Application.RandBetween(-10, 10) 直接生成-10到10之间的随机整数 关于二维数组Redim Preserve: 如果使用了 Preserve 关键字,就只能重定义数组最末维的大小,且根本不能改变维数的数目. 具体参考 1 如果使用了 Preserve 关键字,就只能重定义数组最末维的大小,且根本不能改变维数的数目.例如,如果数组就是一维的,则可以重定义该维的大小,因为它是最末维,也是仅有的一维.不过,如果数组是二维或更多维时,则只有改变其最末

VBA学习笔记之单元格

'单元格对象在VBA中一个非常基础,同时也很重要的. '它的表达方式也是非常的多样化. '---------------------------------------------------- 'Range 对象 '代表某一单元格.某一行.某一列.某一选定区域(该区域可包含一个或若干连续单元格区域),或者某一三维区域. 'Range ("文本型装单元格地址") 'range的常见写法 Sub rng() Range("a1").Select '单元格 Range(

VBA学习笔记之循环

VBA 中Do while Loop用法如下:VBA中如果不知道重复多少次,使用 Do...Loop 语句.Do...Loop 语句重复执行某段代码直到条件是 true 或条件变成 true.重复执行代码直到条件是 true使用 While 关键字来检查 Do... Loop 语句的条件. 1 2 3 Do While i>10   'some code Loop 如果 i 等于 9,上述循环内的代码将终止执行. 1 2 3 Do   'some code Loop While i>10 这个

VBA学习笔记(8)--遍历所有文件夹和文件

说明(2017.3.26): 1. 采用的是兰色幻想教学视频中的"父子转换法" 2. 这种VBA的遍历文件夹方法非常难理解,主要是因为dir这个函数,第一次带参数调用,返回的是此目录下的第一个文件,第二次无参数调用,返回的是此目录下一个第二个文件,这就很操蛋了,还要配合do循环. 3. VBA的各种do..until..loop, do..while..loop, if..then..end if, for 1 to 10..next尼玛这么多关键字要死啊!不骂不痛快!本来思考的就很累