Share via


Item property (Directions)

Returns a Direction object based on its text or position within the route or route segment. Read-only.

Applies to

Collections:  Directions

Syntax

object.Item(Index)

Parameters

Part Description
object Required. An expression that returns a Directions collection.
Index Required Variant. An integer representing the index number of the direction, in order of its placement in the route or route segment.

Remarks

The Item property is the default property for the Directions collection.

Example

    Sub GetSeventhDirection()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map   Dim objRoute As MapPoint.Route
  'Set up the application   Set objMap = objApp.ActiveMap   Set objRoute = objMap.ActiveRoute   objApp.Visible = True   objApp.UserControl = True
  'Add route stops and calculate the route   objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)   objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)   objRoute.Calculate
  'Find the seventh direction item   MsgBox "Item #7 Direction: " _     + objRoute.Directions.Item(7).Instruction
  End Sub

Note  This sample code is specific for use in MapPoint North America; it is for illustration purposes only.