Share via


Reorder method

Moves the waypoint (start point, stop, or end point) of a route to a new position in the route list.

Applies to

Objects:  Waypoint

Syntax

object.Reorder(Order)

Parameters

Part Description
object Required. An expression that returns a Waypoint object.
Order Required GeoOrderCmd. Where in the route list the waypoint should be moved.
GeoOrderCmd Value Description
geoMoveDown
3
Moves the waypoint down one position in the route list
geoMoveToBottom
1
Moves the waypoint to the bottom of the route list
geoMoveToTop
0
Moves the waypoint to the top of the route list
geoMoveUp
2
Moves the waypoint up one position in the route list

Remarks

To return whether a waypoint is a start point, intermediate stop, or end point, use the Type property on the Waypoint object.

Example

    Sub ReorderSecondStop()

  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   objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)   objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
  'Make second waypoint the start point   objRoute.Waypoints.Item(2).Reorder geoMoveToTop
  End Sub

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