Share via


ListPosition property

Returns or sets the position of the waypoint (start point, stop, or end point) in a Waypoints collection. If a waypoint is moved to a new position, all waypoints after that position are moved down one position in the order. The first waypoint is numbered 1. Read/write Long.

Applies to

Objects: Waypoint

Syntax

object.ListPosition

Parameters

Part

Description

object

Required. An expression that returns a Waypoint object.

Example

  Sub FirstStopToSecond()

  Dim objApp As New MapPoint.Application
  Dim objMap As MapPoint.Map
  Dim objRoute As MapPoint.Route
  Dim objLoc As MapPoint.Location

  '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 the first waypoint the second waypoint
  objRoute.Waypoints.Item(1).ListPosition = 2

  End Sub

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