PreferredArrival property
Returns or sets the preferred arrival time at a stop or the end point on a route; similar to clicking Schedule Stop on the Route menu. Returns an error for the start point. Returns midnight if not set. Read/write Date.
Applies to
Objects: Waypoint
Syntax
object.PreferredArrival
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a Waypoint object. |
Example
Sub SetPreferredArrival()
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 two waypoints to the map
objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
objRoute.Waypoints.Add objMap.FindResults("Spokane, WA").Item(1)
'Set the time you'd like to arrive at the end point
objRoute.Waypoints.Item(2).PreferredArrival = TimeValue("1:00:00 PM")
objRoute.Calculate
End Sub
Note This sample code is specific for use in MapPoint North America; it is for illustration purposes only.