ActiveRoute property
Returns the Route object from the map (MapPoint has one route per map). If a route does not currently exist for a map file, returns a route with no waypoints. Read-only.
Applies to
Objects: Map
Syntax
object.ActiveRoute
Parameters
Part |
Description |
---|---|
object |
Required. An expression that returns a Map object. |
Example
Sub UseActiveRoute()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
'Add route stops and calculate the route
objMap.ActiveRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
objMap.ActiveRoute.Waypoints.Add objMap.FindResults("Spokane, WA").Item(1)
objMap.ActiveRoute.Calculate
End Sub
Note This sample code is specific for use in MapPoint North America; it is for illustration purposes only.