Table of contents
TOC
折叠目录
展开目录

Shape.Vertices 属性 (发布服务器)Shape.Vertices Property (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

作为一系列坐标对的形式返回指定任意多边形顶点 (和贝赛尔曲线的控制点) 的坐标。只读变量Returns the coordinates of the specified freeform drawing's vertices (and control points for Bézier curves) as a series of coordinate pairs. Read-only Variant.

语法Syntax

表达式顶点expression. Vertices

表示形状对象的 _expression_A 变量。_expression_A variable that represents a Shape object.

注解Remarks

您可以使用该数组,返回此属性作为参数的AddCurveAddPolyline的方法。You can use the array returned by this property as an argument to the AddCurveor AddPolylinemethods.

下表显示了顶点属性将数组中的值的关联vertArray()使用一个三角形顶点的坐标。The following table shows how the Vertices property associates the values in the array vertArray() with the coordinates of a triangle's vertices.

vertArray 元素vertArray elementContainsContains
vertArray(1, 1)从第一个顶点到页面左边的水平距离。The horizontal distance from the first vertex to the left side of the page.
vertArray(1, 2)从第一个顶点到页面顶部的垂直距离。The vertical distance from the first vertex to the top of the page.
vertArray(2, 1)从第二个顶点到页面左边的水平距离。The horizontal distance from the second vertex to the left side of the page.
vertArray(2, 2)从第二个顶点到页面顶部的垂直距离。The vertical distance from the second vertex to the top of the page.
vertArray(3, 1)从第三个顶点到页面左边的水平距离。The horizontal distance from the third vertex to the left side of the page.
vertArray(3, 2)从第三个顶点到页面顶部的垂直距离。The vertical distance from the third vertex to the top of the page.

示例Example

本示例将当前出版物中第一个形状的顶点坐标赋值给数组变量vertArray(),并显示第一个顶点的坐标。This example assigns the vertex coordinates for shape one in the active publication to the array variable vertArray() and displays the coordinates for the first vertex.

Dim vertArray As Variant 
Dim sngX1 As Single 
Dim sngY1 As Single 

With ActiveDocument.Pages(1).Shapes(1) 
 vertArray = .Vertices 
 sngX1 = vertArray(1, 1) 
 sngY1 = vertArray(1, 2) 
 MsgBox "First vertex coordinates: " &; sngX1 &; ", " &; sngY1 
End With

本示例创建已将当前出版物中第一个形状相同几何描述的曲线。第一个形状必须包含 3n + 1 个顶点为本示例正常运行,其中 n 是大于或等于 1 的整数。This example creates a curve that has the same geometric description as shape one in the active publication. Shape one must contain 3n+1 vertices for this example to work, where n is an integer greater than or equal to 1.

With ActiveDocument.Pages(1).Shapes 
 .AddCurve SafeArrayOfPoints:=.Item(1).Vertices 
End With 
© 2018 Microsoft