Directions property
Returns the collection of sub-directions (Directions collection) for the specified route or direction, if any. Read-only.
Applies to
Syntax
object.Directions
Parameters
Part |
Description |
---|---|
object |
Required. An expression that returns a Direction or Route object. |
Remarks
- Sub-directions (Directions collection for a Direction object) never have their own sub-directions. In other words, there can be only two layers of Directions collections: one for a Route object and one for a Direction object.
Example
Sub UseDirectionsProperty()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objRoute As MapPoint.Route
'Set up 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
'Get the directions and output the first direction instruction
MsgBox "The first direction is: " + _
objRoute.Directions.Item(1).Instruction
End Sub
Note This sample code is specific for use in MapPoint North America; it is for illustration purposes only.