Previous Document Next Document

Object Model Reference : Classes : S : SubPaths : Properties : SubPaths.Item


SubPaths.Item

Property Item(Index As Long) As SubPath

Description

Member of SubPaths

The Item property returns a specified subpath.

Item is the default property of the SubPaths class, and its reference can be omitted when you are accessing items in a SubPaths collection. For example, SubPaths.Item(2) is the same as SubPaths(2) — they both reference the second subpath in the collection.

The Item property returns a read-only value.

Parameter
Description
Index
Specifies the preset placeholder that uniquely identifies each member of the SubPaths collection

VBA example 1

The following VBA 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
VBA example 2

The following VBA 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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.