Share via


Overnights property

Returns or sets the number of nights to stay at a stop on a route. The range is 0–59 nights. The value of this property is 0 if not set. Read/write Long.

Applies to

Objects: Waypoint

Syntax

object.Overnights

Parameters

Part

Description

object

Required. An expression that returns a Waypoint object.

Remarks

  • To schedule a stop for less than one night, use the StopTime property of the Waypoint object.

  • If the Overnights and StopTime properties are both set, the property that was set most recently is used.

Example

  Sub SpendTwoNights()

  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
  With objRoute.Waypoints
    .Add objMap.FindResults("Seattle, WA").Item(1)
    .Add objMap.FindResults("Tacoma, WA").Item(1)
    .Add objMap.FindResults("Redmond, WA").Item(1)
  End With

  'Stay two nights at 2nd stop
  objRoute.Waypoints.Item(2).Overnights = 2
  objRoute.Calculate

  End Sub

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