![]() |
![]() |
SubPaths.Item
Property Item(Index As Long) As SubPath
Member of SubPaths
The Item property returns the specified subpath.
The Item property is the default property and its reference can be omitted when referencing items in the collection. For example, SubPaths.Item(2)
is the same as SubPaths(2)
they both reference the second subpath in the SubPaths collection.
The Item property returns a read-only value.
Parameters
|
Description
|
Index
|
Represents a preset placeholder for each object in a SubPaths collection, uniquely identifying each member of the collection
|
The following code example randomly moves each subpath in the selected curve:
Sub Test() Dim spath As SubPath Dim s As Shape Dim i As Long Set s = ActiveShape For i = 1 To s.Curve.Subpaths.Count Set spath = s.Curve.Subpaths(i) spath.Move Rnd() * 2 - 1, Rnd() * 2 - 1 Next i End Sub
The following code example performs the same procedure as the previous example. However, instead of using a For Next command, it uses the For Each command in Visual Basic to iterate through all subpaths in the shape.
Sub Test() Dim spath As SubPath For Each spath In ActiveShape.Curve.Subpaths spath.Move Rnd() * 2 - 1, Rnd() * 2 - 1 Next spath End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.