设置由 Index 指定的顶点后面线段的类型。如果顶点是曲线段的控点,则此方法设置该曲线的线段类型。请注意,插入或删除邻近顶点可能影响总顶点数。
expression.SetSegmentType(Index, SegmentType)
expression 必需。该表达式返回一个 ShapeNodes 对象。
Index Long 类型,必需。需要设置线段类型的顶点。
SegmentType 必需 MsoSegmentType。 指明线段是直线段还是曲线段。
MsoSegmentType 可以是下列 MsoSegmentType 常量之一: |
msoSegmentLine |
msoSegmentCurve |
本示例将当前文档中图形 3 的所有直线段变为曲线段。图形 3 必须是任意多边形。
Dim lngLoop As Long
With ActiveDocument.Shapes(3).Nodes
lngLoop = 1
While lngLoop <= .Count
If .Item(lngLoop).SegmentType = msoSegmentLine Then
.SetSegmentType lngLoop, msoSegmentCurve
End If
lngLoop = lngLoop + 1
Wend
End With