Share via


TripTime property

Returns the total amount of travel time for the entire route. Returns 0 if the route is not currently calculated. Elapsed time is in fractional days; for example, one hour equals 1/24 (or .041666) of a day. Read-only Double.

Applies to

Objects: Route

Syntax

object.TripTime

Properties

Part

Description

Object

Required. An expression that returns a Route object.

Remarks

Example

  Sub RouteTotalTripTime()

  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

  'Get the trip time of the route
  MsgBox "Trip time of route in minutes: " _
    + CStr(objRoute.TripTime / geoOneMinute)

  End Sub
 

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