Share via


Count property

Returns the total number of objects in a collection. Read-only Long.

  • For AddIns collections, returns the total number of connected COM add-ins.

  • For Adjustments collections, returns the total number of adjustments for a specified Shape object with a AutoShapeType property of geoShapeRadius.

  • For DataRanges collections:

    • Continuous ranges and continuous logarithmic ranges for Shaded Area, Shaded Circle, Sized Circle, and Sized Pie Chart maps return 3

    • Continuous ranges and continuous logarithmic ranges for Column Chart and Series Column Chart maps return 5

    • Discrete equal ranges, discrete logarithmic ranges, and equal data points for Shaded Area, Shaded Circle, Sized Circle, Multiple Symbol, and Sized Pie Chart maps return 1–8

    • Unique values for Shaded Area, Shaded Circle, Sized Circle, Multiple Symbol, and Sized Pie Chart maps return 1–8

    • Unsized Pie Chart maps return 0

  • For Directions collections, returns the total number of directions, including non-driving steps.

  • For FindResults collections, returns the number of found Location or Pushpin objects.

  • For Toolbars collections, returns 4.

Applies to

Collections: AddIns, Adjustments, DataRanges, DataSets, Directions, Fields, FindResults, PlaceCategories, SavedWebPages, Shapes, Symbols, Toolbars, Waypoints

Syntax

object.Count

Parameters

Part

Description

object

Required. An expression that returns a collection in the Applies to list.

Example

  Sub CheckWaypointNumber()

  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

  'Check the number of waypoints in the route
  MsgBox "Number of waypoints: " + CStr(objRoute.Waypoints.Count)

  End Sub

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